Help on a reading from a file programming

Reply

Join Date: Nov 2007
Posts: 2
Reputation: Hyiero is an unknown quantity at this point 
Solved Threads: 0
Hyiero Hyiero is offline Offline
Newbie Poster

Help on a reading from a file programming

 
0
  #1
Nov 8th, 2007
Well I did not have a problem with my last program assignment which involved me making the Student class that I attached below, But in my new assignment i have too Write a program that will use the Student class developed in the previous assignment to provide a menu-based interactive capability. The program will also read/write files. You may have to modify your original Student class.
The main method will create the files and display a menu, read the user's choice from the keyboard, and perform the corresponding action. After each action, the menu is displayed again. This continues until the user chooses "Exit".

Choice 1 will read the next line from the input file, create the student object,
and assign its instance variables.
Choice 2 will prompt the user to create a new student object as in the previous
assignment
Choice 3 will display the student's info in the format given below.
Choice 4 (change info) will display the following submenu:

Change student info
------------------------------------------
1 - change credit hours
2 - change residency (in-state/out-of-state)
3 - change financial aid status and amount
4 - return to main menu

The user is prompted for the new value, and the submenu is redisplayed until
"return to main menu" is selected.

Choices 5 and 6 will display the student's bill on the screen and write it to
the output file, respectively, using the format in the previous assignment.
Output two blank lines after each student bill.

And I don't really know anything about reading from a file or writing out to a file in java and ive done some research on it but none of it is getting through to me, if anyone could help it would be greatly appreciated, I have also attached my p7 file which is the code i have so far on my new assignment and how i have it set up, Thank you to anyone who can help
Attached Files
File Type: java BMR_Student.java (6.1 KB, 6 views)
File Type: java BMRp7.java (2.4 KB, 4 views)
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 4,190
Reputation: peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of 
Solved Threads: 483
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: Help on a reading from a file programming

 
0
  #2
Nov 8th, 2007
Reading from file tutorial
Writing to file tutorial
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 2
Reputation: Hyiero is an unknown quantity at this point 
Solved Threads: 0
Hyiero Hyiero is offline Offline
Newbie Poster

Re: Help on a reading from a file programming

 
0
  #3
Nov 8th, 2007
yes that helps but also how would i go about changing the student class to use the input from a txt file to fill out the information
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 10
Reputation: galanshi is an unknown quantity at this point 
Solved Threads: 0
galanshi galanshi is offline Offline
Newbie Poster

Re: Help on a reading from a file programming

 
0
  #4
Nov 8th, 2007
This class allows you to read an input file.txt specified when invonking the constructor.
It prints out line by line. You can save each line into an array if you want to. Or you can save each word in the line into an array by invoking the split function.
Last edited by jwenting; Nov 9th, 2007 at 12:44 am. Reason: we're not doing kids' homework for them... And use codetags next time you post some code.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC