• Post Reply Bookmark Topic Watch Topic
  • New Topic

Flowchart Question

 
Serkan Kilic
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

I'm asked to write a program for the flowchart that given and this is what i've done so far.It works but looks like something missing.Could someone tell me what it is ?
I attached the picture of the chart.











FullSizeRender.jpg
[Thumbnail for FullSizeRender.jpg]
 
Campbell Ritchie
Marshal
Posts: 52580
119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

Please tell us what the flowchart says and what the program does. Which parts do you think are missing?
Why are you using option panes for input rather than a Scanner object? That is a very old‑fashioned style.
Why are you using option panes for output rather than System.out.println?
 
Campbell Ritchie
Marshal
Posts: 52580
119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That flowchart looks unnecessarily complicated to me. Please check with whoever gave you it.
 
Paweł Baczyński
Saloon Keeper
Posts: 1955
38
Firefox Browser IntelliJ IDE Java Linux Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By the way, there is no need to have two checks in this flow chart.
One should suffice.
 
Liutauras Vilda
Marshal
Posts: 3193
127
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Before you start, please remove all that code from "main" method also. It should be somewhere else, hint for method name you could find maybe even in flowchart.
This code below probably is not what you had in your mind. Anyway, delete that, you won't need it in the form it is now (maybe you could reuse some parts of it in the new method you're might going to create).
 
Serkan Kilic
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:Welcome to the Ranch

Please tell us what the flowchart says and what the program does. Which parts do you think are missing?
Why are you using option panes for input rather than a Scanner object? That is a very old‑fashioned style.
Why are you using option panes for output rather than System.out.println?


it basically says "Write Java Statements for the following flowchart:".
I'm instructed to do that by using if statements.

The thing makes me confused "Set Focus to Balance Textbox" at the end. I have no idea what it stands for there.

Thank you for the help.
 
Knute Snortum
Sheriff
Posts: 3267
84
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The thing makes me confused "Set Focus to Balance Textbox" at the end. I have no idea what it stands for there.

That would make sense if you were doing a full GUI. It doesn't make sense if you're just using OptionPanes.
 
Liutauras Vilda
Marshal
Posts: 3193
127
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Serkan Kilic wrote:I have no idea what it stands for there.

Such questions you could clarify with your tutor or you could check with your classmates to see if you all understand the same.
 
Campbell Ritchie
Marshal
Posts: 52580
119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Serkan Kilic wrote:. . .
it basically says "Write Java Statements for the following flowchart:".
. . .
The thing makes me confused "Set Focus to Balance Textbox" at the end. I have no idea what it stands for there.

Thank you for the help.
I think I am going to have to ask the question again. What does the flowchart say? When you write that down you will know what to write and also whether you have done it correctly.

The bit about text box probably refers to a GUI component which you can read about in the Java™ Tutorials. It basically means that when you have finished everything else you should make a text box request the focus. You know that you get parts of a website activated and inactivated? If not, push the tab key a few times while you are reading this. You will see that different parts of the website have a faint box appear round them. Those parts have the focus; it you push keys like enter or space whichever button link etc has the focus is activated. If you don't know what a text box is yet, then you won't know how to get one to appear nor how to give it the focus. You could try with
myTextBox.grabFocus().
But do you actually know what a text box is? I couldn't find a class called text box. As Liutauras says, you should query that with your teacher.
 
Campbell Ritchie
Marshal
Posts: 52580
119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A few minutes ago, I wrote:. . .
whether you have done it correctly.
. . .
Paweł and I have already hinted that your flowchart might do with some explanation, but I think you have just about correctly implemented those parts of it which you actually understand.
 
Serkan Kilic
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'll to my instructor as you suggested.
Thank you all.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!