There are tools and techniques for working on program logic.
The one I learned was flowcharts. Using paper and pencil you draw a diagram that describes the logic for the program. Use a pencil so...
Type: Posts; User: Norm
There are tools and techniques for working on program logic.
The one I learned was flowcharts. Using paper and pencil you draw a diagram that describes the logic for the program. Use a pencil so...
That looks like you need to work out some logic before trying to code it.
Try this: write an if statement to compare the contents of the String: userInput to the String: "yes" using the equals() method.
Ok. Write the code for those three steps, compile it and test it.
Is this what should be done next after the user's first input is read:
compare user's input to the String: "t"
Is that an assignment statement, like this:
other = response; // save response in other
I assume the user's response to the question will be read and saved in a variable
then what?
What is the one thing the code must do after the user enters the response to the first question? Don't try to do it all at once. One step at a time.
Take it one step at a time and test that each step is done correctly
Ask a question << does the code do this OK?
read the response << what is read? Add a println to print out what was read so...
What are you trying to do?
If you want to compare String objects for equality use the equals() method.
If the variable: input is a String object you need to use one of the String class's methods for comparing Strings or the equals() method for an exact match.
See the API doc for the String class for...
The code in post#9 had the correct method for reading String input from the user. The code in posts #1 and #13 do not. Use the Scanner method from post#9 to read a String.
After reading the user...
There are several compiler errors that need to be fixed before the code will compile and execute for testing.
How many versions of the source code do you have? The code in post#1 has several...
Strange that the message: Enter No of starter:
was NOT printed before the call to the nextInt() method.
The posted code has errors when compiled that need to be fixed so the code can be...
Please copy the full text of the error message and paste it here.
What Scanner methods are you using to read the user's input? Read the Scanner class's API doc to get the correct method to use for...
How is the program supposed to work? It looks like the user must make the same answer ( a 1) to all of the questions he is asked.
Some of the questions look like they would require a response of...
Please edit your post and wrap your code with
//<<<<<<<< This before
<YOUR CODE HERE>
//<<<<<<<< This after
Please edit your post and wrap your code with
<YOUR CODE HERE>
to get highlighting and preserve formatting.