Complete the code to counts the number of lines input

Assignment Help JAVA Programming
Reference no: EM13694945

Question: 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" );

I cannot seem to get this to work for some reason could somebody provide me a code to compare and test?

Reference no: EM13694945

Questions Cloud

Use m8c assembler directives to allocate : Use M8C assembler directives to allocate the constants in ROM. Assume that they are all in the "lit" area.
Explain the entry of na+ provides a free-energy : Problem- Glucose is pumped into some animal cells by a symporter powered by the simultaneous entry of Na+. The entry of Na+ provides a free-energy input of 10.8kJ/mol under typical cellular conditions
Write an appropriate me expression : Write an appropriate ME expression capturing the essence of each of the following topics:
What product would this situation most likely obtain : What product would this situation most likely obtain. What possible reactions could be run to make it possible to obtain crystals upon crystallization
Complete the code to counts the number of lines input : 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.
Calculate the ph of a buffer hno2 : Problem- Calculate the pH of 1.00 L of a buffer that is 0.120 M HNO2 and 0.150 M NaNO2 before and after the addition of 1.00 ml if 12.0 M HCL(aq)
Explain a sample of gas with an initial volume : Problem- A sample of gas with an initial volume of 33.5L at a pressure of 755mmHg and a temperature of 325K is compressed to a volume of 15.6L and warmed to a temperature of 425K.
Calculate the molar mass that would be obtained data : Problem- Calculate the molar mass that would be obtained from the actul experimental data under the following conditions. The unknown is mehy propy ether (CH3OC3H7) which has the vapor pressure of 375.2 torr at room temperature, 20C.
Full subtractor : Show that a full subtractor can be implemented using a "Full Adder" device and two inverter gates - For this, you will have to create a "Full Adder" device (Note: you can use the idea of what you built in question 2)

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd