Please edit your code and wrap it in code tags. Use the [code] icon above the input box.
What is your problem with the code? What does it do? What do you want it to do?
If you get errors, please copy and paste here the full text of the message.
NormR1
Posting Expert
6,677 posts since Jun 2010
Reputation Points: 1,138
Solved Threads: 656
Please edit your code and wrap it in code tags. Use the [code] icon above the input box.
1)What is your problem with the code?
2)What does it do? Show its output
3)What do you want it to do?
If you get errors, please copy and paste here the full text of the message.
You answered one part of my post (#3). What about the rest?
NormR1
Posting Expert
6,677 posts since Jun 2010
Reputation Points: 1,138
Solved Threads: 656
Can you answer any of my questions?
For example can you execute the program, copy its output and paste it here?
To copy the contents of the command prompt window:
Click on Icon in upper left corner
Select Edit
Select 'Select All' - The selection will show
Click in upper left again
Select Edit and click 'Copy'
Paste here.
And then add comments to it showing where you want the output to be different.
We don't do homework here. We help OPs solve their problems. So far you have not explained what your problem is. Saying "help me complete this" is not how to show what your problem is.
NormR1
Posting Expert
6,677 posts since Jun 2010
Reputation Points: 1,138
Solved Threads: 656
That is probably a good idea. You need to understand how computer programs are put together and how computers work before you try to design a computer program.
You need to design your program before you try to write it.
What you posted looks like you are trying to write the program without any design.
You say i just know what my goal is. That is the starting point, then you must break it up into small steps that will accomplish that goal. Then you must translate those steps to a java program.
NormR1
Posting Expert
6,677 posts since Jun 2010
Reputation Points: 1,138
Solved Threads: 656
Take the steps one at a time. First solve this one:
It should ask a name,
You should look at the Scanner class for an easy way to read in data from the console.
If you Search on this forum, there are lots of examples that use Scanner.
NormR1
Posting Expert
6,677 posts since Jun 2010
Reputation Points: 1,138
Solved Threads: 656