Question
Lili is studying data from lecturers, students and the student family. If a lecturer knows student X, he will also know the family of student
Lili is studying data from lecturers, students and the student family. If a lecturer knows student X, he will also know the family of student X.
We know the fact that a lecturer can have more than 1 student, and every student must have a family.
The attributes of the lecturer are :
Lecturers code (Kode dosen)
Lecturers name (Nama dosen)
Lecturers gender (Jenis kelamin) (Laki-laki / Perempuan)
Number of student
The attributes of students are :
Students code (Kode mahasiswa)
Students name (Nama mahasiswa
Students gender (Jenis Kelamin)
Family details (will be explained below)
The attribute of the family is :
Fathers name (Nama ayah)
Mothers name (Nama ibu)
Number of siblings (Jumlah saudara kandung)
However, because there were so many lecturer data, Lili was confused when she wanted to find out who were the people who were known by the i-th lecturer. Help Lili to display all data known by the i-th lecturer as well as that lecturers data.
Format Input
The first row input contains N, the number of lecturers. For input each lecturer consists of :
The first 4 lines are lecturers biodata.
Followed by 6 lines for each students (contains students profile data)
In the last line of input after the input of all lecturers consists of an integer K, this integer shows the i-th lecturer that Lili wants to know.
Format Output
Output consists of 4+6 N lines, where the first 4 lines are the lecturer;s data and N is the number of students lecturer K has. 6 N lines contain all the profile data of the student. Constraints
1 N 100
K N 0 Number of students per lecturer 100
1 |Lecturers code|, |Students code|, |Name| 30
Sample Input (standard input)
2
D8903
Bibi
Perempuan
1
B1234
Jojo
Laki-laki
MrJojo
MsJojo
3
D3456
Bibii
Laki-laki
2
B9876
Jojoo
Laki-laki
MrJojoo
MsJojoo
3
B7777
Jo
Laki-laki
MrJo
MsJo
0
2
Sample Output (standard output)
Lecture Code: D3456
Lecture Name: Bibii
Lecture Gender: Laki-laki
Number of Student : 2
Student Code: B9876
Student Name: Jojoo
Student Gender: Laki-laki
Father Name: MrJojoo
Mom Name: MsJojoo
Number of Siblings: 3
Student Code: B7777
Student Name: Jo
Student Gender: Laki-laki
Father Name: MrJo
Mom Name: MsJo
Number of Siblings: 0
USE C++ LANGUAGE INPUT OUTPUT MUST BE THE SAME
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started