回分類題庫
d236: 102OOP Lab Exercise: Student Class (Advanced)
出處:

Difficulity : N/A
Accepted : 38 Times | Submit :163 Times | Clicks : 1052
Accepted : 37 Users | Submit : 37 Users | Accepted rate : 100%
Time Limit :10000 ms | Memory Limit : 64000 KBytes
題目加入時間 : 2013-10-10 23:01

Content :

The Student Class records a student name, a studentID, a Email, a PhoneNumber.
Your task is to write:  Main.cc, Student.h, Student.cc in C++. 

Student.h /Student.cc are the definition and implementation of class Student. Please concetrate on Object Oriented Concepts such as Encapsulation.

Main.cc is the implementation of handling input, output ...etc.
Adding some functions is always a good idea.

(ex. Sort function, Print function, Replace function…etc.)

Input :

There are several sets of test data.

For each set of data:
 The first line is an integer N indicates the number of the Student.
 The following N lines, each line is a record of a student.
 Each record of student is consist of four inputs separated by space.

 The syntax is : Name, ID, Email, Phone 

 Then, Read instructions to print or modify the data.

 There are five instructions as following:
  Print
  Sort
  Find [ID]
  Replace [ID] [Syntax (WhichData)] [Data]
  Quit

When inputting “Quit”, start the next set of test data.

Output :

Please refer to sample output.

Print”There is not the corresponding data.” when Find [ID] or Replace [ID] [Syntax (WhichData)] [Data] failed.

(Print fifty ‘=’ after outputting the result of an instruction )

Sample Input :

1
LELF 1020202 1020202@nccu.edu.tw 0900-000000
Print
Quit
3
MAKOTO 102753005 102753005@nccu.edu.tw 09xx-xxxxxx
Co 102753004 102753004@nccu.edu.tw 09xx-xxxxxx
KOBA 102753002 101753002@nccu.edu.tw 09xx-xxxxxx
Print
Sort
Find 102753005
Find 102753003
Replace 102753005 ID 521337
Sort
Quit

Sample Output :

Name: LELF
ID: 1020202
Email: 1020202@nccu.edu.tw
Phone: 0900-000000
==================================================
Name: MAKOTO
ID: 102753005
Email: 102753005@nccu.edu.tw
Phone: 09xx-xxxxxx
Name: Co
ID: 102753004
Email: 102753004@nccu.edu.tw
Phone: 09xx-xxxxxx
Name: KOBA
ID: 102753002
Email: 102753002@nccu.edu.tw
Phone: 09xx-xxxxxx
==================================================
Name: KOBA
ID: 102753002
Email: 102753002@nccu.edu.tw
Phone: 09xx-xxxxxx
Name: Co
ID: 102753004
Email: 102753004@nccu.edu.tw
Phone: 09xx-xxxxxx
Name: MAKOTO
ID: 102753005
Email: 102753005@nccu.edu.tw
Phone: 09xx-xxxxxx
==================================================
Name: MAKOTO
ID: 102753005
Email: 102753005@nccu.edu.tw
Phone: 09xx-xxxxxx
==================================================
There is not the corresponding data.
==================================================
Name: MAKOTO
ID: 521337
Email: 102753005@nccu.edu.tw
Phone: 09xx-xxxxxx
==================================================
Name: MAKOTO
ID: 521337
Email: 102753005@nccu.edu.tw
Phone: 09xx-xxxxxx
Name: KOBA
ID: 102753002
Email: 102753002@nccu.edu.tw
Phone: 09xx-xxxxxx
Name: Co
ID: 102753004
Email: 102753004@nccu.edu.tw
Phone: 09xx-xxxxxx
==================================================

Hint :


  

Author :

(管理員:oopTA)

  Solve it!   Status Forum (0)

C++
C
JAVA
48147. oop101703036 (4 ms , 430KB)
48156. oop101703017 (6 ms , 472KB)
48154. oop101703004 (6 ms , 470KB)
48148. oop101703035 (6 ms , 426KB)
48140. oop101703045 (6 ms , 434KB)
沒有解題記錄 57744. nwgs524513cja (84 ms , 194KB)

執行時間會受很多因素影響因此僅供參考,主機等級請看這裡