Click here to Skip to main content
15,886,258 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
- Design and implement a Student class.

a. Each student has the following Data Fields:
 studentFirstName,
 studentLastName,
 studentAddress,
 studentBloodGroup must be: A, A-, B, B-, AB, AB-, O or O-. Nothing else.
 studentCity.

 Write the following elements :

 Write a Constructor to initialize the values of the Data Fields (attributes).  Write Accessor and Mutator methods for each data.
 Write a tostring() method to print all the student information’s to
standard output.
 Create a main class called StudentDemo.java that uses the student class.

a. Read student info’s from an input file students.txt and create a student object.
 Sample file : Students.txt
200912345 ahmad shamsi 11th street, nakheel A+ Al Ain
201023456 asmaa Nuaimi zayed street, tawiya O Dubai
201124456 rached teniji matter road, lissali B+ Abu Dhabi

b. Write a method that generates for a student a file named id.txt that contents same as the following example:
 200912345.txt
Student Id: 200912345
Student name: ahmad shamsi
Address: 11th street, nakheel
City: Al Ain
BloodType: A+
Posted
Updated 7-Mar-13 3:35am
v2
Comments
[no name] 7-Mar-13 9:10am    
This is just a copy/paste of your homework assignment. No one here is going to do it for you.

1 solution

We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.

Try it yourself, you may find it is not as difficult as you think!
 
Share this answer
 
Comments
soname 7-Mar-13 10:36am    
ok i just need to know
how to read from a file
using another class
OriginalGriff 7-Mar-13 10:43am    
Google is your first stop:

https://www.google.co.uk/search?q=read+text+file+netbeans&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a&channel=fflb

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900