| | |
Help on a reading from a file programming
![]() |
•
•
Join Date: Nov 2007
Posts: 2
Reputation:
Solved Threads: 0
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
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
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
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
•
•
Join Date: Nov 2007
Posts: 10
Reputation:
Solved Threads: 0
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.
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.
![]() |
Similar Threads
- problems with reading random access line from a file (C++)
- Reading a file into a Parallel Array (C++)
- problems with reading in file (C++)
- First year assigment on reading file, sorting and outputting invoice (C++)
- Error Message Concerning Reading File From A Drive (C++)
- URGENT - Reading from txt file into a 2 dimension array (Java)
- reading a file into code (Java)
- reading and printing a file to screen in C (C)
Other Threads in the Java Forum
- Previous Thread: Adding components at runtime ontop of a scrollable table
- Next Thread: while loop
| Thread Tools | Search this Thread |
6 @param actuate android api applet application arc array arrays automation balls binary bluetooth bold business byte c++ chat class client code codesnippet collections compare component coordinates database defaultmethod detection doctype dragging ebook eclipse educational error file fractal froglogic game givemetehcodez graphics gui guitesting helpwithhomework hql html ide ideas image ingres input integer internet intersect invokingapacheantprogrammatically j2me java javaexcel javaprojects jni jpanel jtextarea julia linux list map method methods mobile mysql netbeans newbie nextline parameter php pong problem program programming project recursion recursive scanner sell server set sms sort sql string sun swing swt terminal threads tree web websites windows






