| Author |
Message |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 10/04/2011 19:58:54
|
smithnya
Newbie
Joined: 10/04/2011 19:51:09
Messages: 1
Offline
|
Hello everyone. I have virtually no knowledge of Java as I am taking my first college class in Java programming. I am supposed to write a small java application to gather and display three sets of information regarding a student's class record. I have to ask the student for the name of the class, the course number, and his/her grade. I figured it out how to do it using simply if statements, but I have to do this three times using a while loop. My question is, how do I extract the information each time the loop executes? I know how to do the loop, but I lose the information every time the loop executes.
|
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 10/05/2011 10:38:47
|
stdunbar
Newbie
![[Avatar]](/images/avatar/a87ff679a2f3e71d9181a67b7542122c.png)
Joined: 06/22/2005 14:51:37
Messages: 884
Location: Superior, CO, USA
Offline
|
Can you show us some code where you're having an issue? I'm not sure I'm following you.
|
Thanks for using the forums at hotjoe.com |
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 10/24/2011 09:15:45
|
AllanOcelot
Newbie
![[Avatar]](/images/avatar/a9eb812238f753132652ae09963a05e9.png)
Joined: 10/24/2011 08:50:21
Messages: 3
Offline
|
Hi,
From your post I gather you want to do the following.
above is not actual code, its, prep-code if you will. Just so I know we are on the same track.
Assuming that the above is what you want to do, then you would need to create GETTERS and SETTERS in the class and create your main class, do the following.
Main --
Create three students:
repeat above two more times with information
Next youll want to get and print the grades to the console, presuming you do ont need a gui in your early lessons.
So, simple do System.out.println("The students results are " + Allan.getStudetName " " + Allan.getStudentClass + "" + Allan.getStudentGrade);
do the System out print for every student in your main method, it will print out the Students Variables (name,Class,Grade).
I hope this helps, if it did im happy, if not, im sorry. But I will try and help more if you elaborate on your code.
|
He Never Said A Mumblin' Word. |
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 11/28/2011 23:44:07
|
jobkhoz
Newbie
Joined: 11/28/2011 23:39:23
Messages: 1
Offline
|
I am also trying this to solve the issue.
|
|
|
 |
|
|