You should make up a transaction file with at least 3 records of students.
Write a main program that creates a collection of students. Your transaction file contains a set of information about students. Your program should contain four classes: StudentProfile, Person, Student, and Course.
StudentCollection has the following attributes:
vector<StudentProfile> StCollection;
StudentProfile class has the following attributes:
Person
PersonalInfo
Student
StdInfo
Person class has the following attributes:
long
SSN
string
Fname
string
Lname
int
Age
char
Gender (‘M’ for Male and ‘F’ for Female)
Student class has the following attributes:
long
StNo
Course
Course1
Course
Course2
Course
Course3
Course Course4
Course Course5
Course class has the following attributes:
long
CourseNum
string
CourseName
Place the following in your transaction file:
123456789
Mary
Anderson
20
F
9800300699
32451
CS211
23145
CS231
87690
Phy301
25677
Chem210
22213
Math210
633322789
Mike
Smith
22
M
9080022299
32251
CS111
11122
Math110
87969
Phy200
25627
Chem110
33313
Bio211
631322111
Michelle
Brown
25
F
611354321
11111
CS911
22222
Math912
33333
Phy913
44444
Chem914
55555
Bio915
class studentProfile{
Person PersonalInfo;
Student StdInfo;
StudentProfile(Person PersonalInfo,Student StdInfo){
PersonalInfo.this=PersonalInfo;
StdInfo.this=StdInfo;
}
}
class Person{
long SSN;
string Fname;
string Lname;
int Age;
char Gender ;
person(long SSN,string Fname,string Lname,int Age,char
Gender){
SSN.this=SSN;
Fname.this=Fname;
Lname.this=Lname;
Age.this=Age;
Gender.this=Gender;
}
}
class Student{
long StNo;
Course Course1;
Course Course2;
Course Course3;
Course Course4;
Course Course5;
Student(long StNo,Course Course1,Course Course2,Course
Course3,Course Course4,Course Course5){
StNo.this=StNo;
Course1.this=Course1;
Course2.this=Course2;
Course3.this=Course3;
Course4.this=Course4;
Course5.this=Course5;
}
}
class Course{
long CourseNum;
string CourseName;
Course(long CourseNum,string CourseName){
CourseNum.this=CourseNum;
CourseName.this=CourseName;
}
}
class transaction{
public static void main(String args[]){
vector<StudentProfile> StCollection= new
Vector<StudentProfile>();
Person p1= new Person(123456789,"Mary","Anderson",20,"F");
Person p2= new Person(633322789,"Mike","Smith",22,"M");
Person p3= new Person(631322111,"Michelle","Brown",25,"F");
Course c1= new Course(32251,"CS111");
Course c2= new Course(11122,"Math110");
Course c3= new Course(87969,"Phy200");
Course c4= new Course(25627
,"Chem110");
Course c5= new Course(33313
,"Bio211");
Course c6= new Course(11111
,"CS911");
Course c7= new Course(22222
,"Math912");
Course c8= new Course(33333
,"Phy913");
Course c9= new Course(44444
,"Chem914");
Course c10= new Course(55555
,"Bio915");
Course c11= new Course(32251
,"CS111");
Course c12= new Course(11122
,"Math110");
Course c13= new Course(87969
,"Phy200");
Course c14= new Course(25627
,"Chem110");
Course c15= new Course(33313
,"Bio211");
Student student1= new Student(9800300699,c1,c2,c3,c4,c5);
Student student2= new Student(9080022299,c6,c7,c8,c9,c10);
Student student3= new Student(611354321,c11,c12,c13,c14,c15);
StudentProfile sp1= new StudentProfile(p1,student1);
StudentProfile sp2= new StudentProfile(p2,student2);
StudentProfile sp3= new StudentProfile(p3,student3);
stCollection.add(sp1);
stCollection.add(sp2);
stCollection.add(sp3);
System.out.println("code working for itteration do");
}
}
Get Answers For Free
Most questions answered within 1 hours.