Complete the code to counts the number of lines input by a user until the user enters the string ENDOFDATA (must be uppercase letters, no spaces) on a line by itself. Make sure you display the number of lines found. Use the nextLine() method of Scanner class to read entire lines of data. (Hint, this is like counting the number of integers entered, but reading Strings and using String comparison to check for equality).
String SENTINEL = “ENDOFDATA”;
Scanner keyboard = new Scanner(System.in);
System.out.println( “Enter lines of data or ” + SENTINEL + ” to quit” );
Are you looking for a similar paper or any other quality academic essay? Then look no further. Our research paper writing service is what you require. Our team of experienced writers is on standby to deliver to you an original paper as per your specified instructions with zero plagiarism guaranteed. This is the perfect way you can prepare your own unique academic paper and score the grades you deserve.
Use the order calculator below and get started! Contact our live support team for any assistance or inquiry.
[order_calculator]