Click here to Skip to main content
13,050,358 members (138,215 online)
Rate this:
Please Sign up or sign in to vote.
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 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 7-Mar-13 3:04am
Updated 7-Mar-13 3:35am
ThePhantomUpvoter 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

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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!
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:

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 7 Mar 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100