Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

E

COMP6047 – Algorithm and Programming

T
T
NO
BU
College Student
Bibi is a lecturer who manages a student database at a university. Before Bibi existed, the
student database was not well organized, and was not collected per student, so students’
data could be chopped up and scattered irregularly between one another.

I
Because Bibi is a lecturer who has studied “struct”, Bibi wants to store all the data given

R
O
in the struct. Making it easier to find and reuse.

You are encouraged to use the struct method to solve this problem to make it easier to
store data.
T
D

Data from students can contain:


S
• Name (Nama)

• NIM
DI

• Age (Umur)

• Postal Code (Kode Pos)


OT
UT
RE

• Place of Birth (Tempat Lahir)

• Date of Birth (Tanggal Lahir)

• High School (Almamater SMA)

• Number of Siblings (Jumlah Saudara Kandung)


N
IB
• Height (Tinggi Badan)

• Bank Account Number (NOMOR REKENING)


TR
DO

Format Input
The input in the first row contains an integer N , how much student data you have to
save. For the next N ×10 rows of student data you must save sequentially from the Name
until Account Number
IS

Format Output
The output consists of (N × 10) + N lines. Student data is preceded by “Mahasiswa
ke-X:”, where X is the order of students.
ED

© School of Computer Science - BINUS, 2021. No part of the materials available may be copied,
photocopied, reproduced, translated, or reduced to any electronic medium or machine-readable form,
in whole or in part, without prior written consent of School of Computer Science - BINUS. Any other
reproduction in any form without the permission of School of Computer Science - BINUS is probihited.
Violators of this clause may be academically sanctioned.
E
COMP6047 – Algorithm and Programming

T
T
Constraints

NO
• 1 ≤ N ≤ 100

BU
• 1 ≤ |N ame| ≤ 100

• |N IM | = 9

• 1 ≤ Age ≤ 100

I
• |P ostalCode| = 6

R
O
• 1 ≤ |P laceOf Birth| ≤ 100

• 1 ≤ |DateOf Birth| ≤ 100


T
D

• 1 ≤ |HighSchool| ≤ 100

• 1 ≤ N umberof Siblings ≤ 100


S
• 1 ≤ Height ≤ 1000
DI

• |BankAccountN umber| = 9

Sample Input (standard input)


OT
UT
RE

2
Lili
123456789
13
786431
Jakarta
N
IB
14SEPT2010
Bina Nusantara School
7
123
968543769
TR
DO

Jojo
125676789
22
711111
Bekasi
1JANUARY2018
IS

Bina Nusantara School


99
12
890234789
ED

© School of Computer Science - BINUS, 2021. No part of the materials available may be copied,
photocopied, reproduced, translated, or reduced to any electronic medium or machine-readable form,
in whole or in part, without prior written consent of School of Computer Science - BINUS. Any other
reproduction in any form without the permission of School of Computer Science - BINUS is probihited.
Violators of this clause may be academically sanctioned.
E
COMP6047 – Algorithm and Programming

T
T
Sample Output (standard output)

NO
BU
Mahasiswa ke-1:
Nama: Lili
NIM: 123456789
Umur: 13
Kode Pos: 786431
Tempat Lahir: Jakarta

I
Tanggal Lahir: 14SEPT2010
Almamater SMA: Bina Nusantara School

R
O
Jumlah Saudara Kandung: 7
Tinggi Badan: 123
NOMOR REKENING: 968543769
T
Mahasiswa ke-2:
D

Nama: Jojo
NIM: 125676789
Umur: 22
S
Kode Pos: 711111
Tempat Lahir: Bekasi
DI

Tanggal Lahir: 1JANUARY2018


Almamater SMA: Bina Nusantara School
Jumlah Saudara Kandung: 99
Tinggi Badan: 12
NOMOR REKENING: 890234789
OT
UT
RE

Note
The AlmamaterSM A data may contain several spaces.
N
IB
TR
DO
IS
ED

© School of Computer Science - BINUS, 2021. No part of the materials available may be copied,
photocopied, reproduced, translated, or reduced to any electronic medium or machine-readable form,
in whole or in part, without prior written consent of School of Computer Science - BINUS. Any other
reproduction in any form without the permission of School of Computer Science - BINUS is probihited.
Violators of this clause may be academically sanctioned.
E
COMP6047 – Algorithm and Programming

T
T
NO
BU
College Student
Bibi adalah seorang dosen yang mengurus database mahasiswa pada sebuah universitas.
Sebelum ada Bibi, database mahasiswa tidak tersusun dengan baik, dan tidak dikumpulkan
per mahasiswa, sehingga data para mahasiswa dapat tercacah dan tersebar tidak teratur
antara satu dan yang lainnya.

R I
O
Karena Bibi adalah seorang dosen yang sudah mempelajari “struct”, maka Bibi ingin
menyimpan semua data yang diberikan dalam struct. Sehingga memudahkan untuk dicari
dan digunakan kembali.
T
D

Anda diharapkan untuk menggunakan metode struct dalam menyelesaikan permasalahan


ini untuk mempermudah anda dalam penyimpanan data.
S
Data dari mahasiswa dapat mengandung :
DI

• Nama

• NIM

• Umur
OT
UT
RE

• Kode Pos

• Tempat Lahir

• Tanggal Lahir
N
• Almamater SMA
IB
• Jumlah Saudara kandung

• Tinggi Badan
TR
DO

• Nomor Rekening

Format Input
Input pada baris pertama berisi sebuah integer N , banyaknya data mahasiswa yang harus
anda simpan. Untuk N × 10 baris berikutnya terdiri dari data mahasiswa yang harus
IS

anda simpan berurutan dari Nama hingga Nomor Rekening.


ED

© School of Computer Science - BINUS, 2021. No part of the materials available may be copied,
photocopied, reproduced, translated, or reduced to any electronic medium or machine-readable form,
in whole or in part, without prior written consent of School of Computer Science - BINUS. Any other
reproduction in any form without the permission of School of Computer Science - BINUS is probihited.
Violators of this clause may be academically sanctioned.
E
COMP6047 – Algorithm and Programming

T
T
Format Output

NO
BU
Output terdiri dari (N × 10) + N baris. Data mahasiswa didahului oleh “Mahasiswa
ke-X:”, dimana X merupakan nomor urutan mahasiswa.

Constraints
• 1 ≤ N ≤ 100

I
• 1 ≤ |N ama| ≤ 100

R
O
• |N IM | = 9

• 1 ≤ U mur ≤ 100
T
D

• |KodeP os| = 6

• 1 ≤ |T empatLahir| ≤ 100
S
• 1 ≤ |T anggalLahir| ≤ 100
DI

• 1 ≤ |AlmamaterSM A| ≤ 100

• 1 ≤ JumlahSaudaraKandung ≤ 100

• 1 ≤ T inggiBadan ≤ 1000
OT
UT
RE

• |N omorRekening| = 9

Sample Input (standard input)


2
N
Lili
IB
123456789
13
786431
Jakarta
TR
DO

14SEPT2010
Bina Nusantara School
7
123
968543769
Jojo
IS

125676789
22
711111
Bekasi
1JANUARY2018
ED

© School of Computer Science - BINUS, 2021. No part of the materials available may be copied,
photocopied, reproduced, translated, or reduced to any electronic medium or machine-readable form,
in whole or in part, without prior written consent of School of Computer Science - BINUS. Any other
reproduction in any form without the permission of School of Computer Science - BINUS is probihited.
Violators of this clause may be academically sanctioned.
E
COMP6047 – Algorithm and Programming

T
T
Bina Nusantara School
99

NO
BU
12
890234789

Sample Output (standard output)

I
Mahasiswa ke-1:
Nama: Lili

R
O
NIM: 123456789
Umur: 13
Kode Pos: 786431
T
Tempat Lahir: Jakarta
D

Tanggal Lahir: 14SEPT2010


Almamater SMA: Bina Nusantara School
S
Jumlah Saudara Kandung: 7
Tinggi Badan: 123
NOMOR REKENING: 968543769
DI

Mahasiswa ke-2:
Nama: Jojo
NIM: 125676789
Umur: 22
OT
Kode Pos: 711111

UT
RE

Tempat Lahir: Bekasi


Tanggal Lahir: 1JANUARY2018
Almamater SMA: Bina Nusantara School
Jumlah Saudara Kandung: 99
Tinggi Badan: 12
NOMOR REKENING: 890234789
N
IB
Note
Data AlmamaterSM A dapat mengandung beberapa spasi.
TR
DO
IS
ED

© School of Computer Science - BINUS, 2021. No part of the materials available may be copied,
photocopied, reproduced, translated, or reduced to any electronic medium or machine-readable form,
in whole or in part, without prior written consent of School of Computer Science - BINUS. Any other
reproduction in any form without the permission of School of Computer Science - BINUS is probihited.
Violators of this clause may be academically sanctioned.

You might also like