[hotjoe.com] HotJoe Java Help Forums
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Visit java.com
Missing post? - see this post about spam for more information.
While loop help for newbie  XML
Forum Index » New to Java
Author Message
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.
stdunbar

Newbie
[Avatar]

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
[WWW] [Yahoo!] [ICQ]
AllanOcelot

Newbie
[Avatar]

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.
jobkhoz

Newbie

Joined: 11/28/2011 23:39:23
Messages: 1
Offline

I am also trying this to solve the issue.
[WWW]
 
Forum Index » New to Java
Go to:   
Powered by JForum 2.1.9 © JForum Team
This site run by Scott Dunbar of Xigole Systems. © 2005-2012 - Scott Dunbar
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners
hotjoe.com, xigole.com, and Scott Dunbar have no affiliation with Oracle