Question

You should make up a transaction file with at least 3 records of students. Write a...

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

Homework Answers

Answer #1

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");

}
}

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Write a program of wordSearch puzzle that use the following text file as an input. The...
Write a program of wordSearch puzzle that use the following text file as an input. The output should be like this: PIXEL found (left) at (0,9). ( Use JAVA Array ) .Please do not use arrylist and the likes! Hints • The puzzle can be represented as a right-sized two-dimensional array of characters (char). • A String can be converted into a right-sized array of characters via the String method toCharArray. . A word can occur in any of 8...
Write a Python 3 program called “parse.py” using the template for a Python program that we...
Write a Python 3 program called “parse.py” using the template for a Python program that we covered in this module. Note: Use this mod7.txt input file. Name your output file “output.txt”. Build your program using a main function and at least one other function. Give your input and output file names as command line arguments. Your program will read the input file, and will output the following information to the output file as well as printing it to the screen:...
PLEASE READ THE ARTICLES ATTACHED AND ANSWER THE FOLLOWING QUESTION. THE ARTICLES ARE BOTH LISTED PLEASE...
PLEASE READ THE ARTICLES ATTACHED AND ANSWER THE FOLLOWING QUESTION. THE ARTICLES ARE BOTH LISTED PLEASE PROVIDE DETAILED EXPLANATIONS. PLEASE WRITE ONE REFLECTION COMBINING BOTH ARTICLES. The purpose of the Article Reflection is to deepen your engagement with the topic of Epidemiology. It will give you the opportunity to reflect on the current real-life epidemiological issues at hand and help to bring meaning to them. ARTICLE 1: A group of students knew they had covid-19. They hosted a party over...
As you saw from the lab PowerPoint slides last week, you will be doing a research...
As you saw from the lab PowerPoint slides last week, you will be doing a research study looking at ‘Aggression Priming” for your first paper. For this week’s discussion, I want you to discuss with your group what you think this study is about. What is the hypothesis? What theory does it come from? What do you predict will happen (do you expect something different than the hypothesis in the researcher instructions? If so, what and why?)? Do you think...
1) Describe an example of each of the following that may be found of your kitchen:...
1) Describe an example of each of the following that may be found of your kitchen: Explain how your choice falls into this category, and if there is a chemical name or symbol for it, provide that as well. Provide a photo of your example with your ID card in it. a) a compound b) a heterogeneous mixture c) an element (symbol) Moving to the Caves… Lechuguilla Caves specifically. Check out this picture of crystals of gypsum left behind in...