Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (99.89 KB, 2 trang )
Mark Calculator
Test topic: C/C++ Practice
Exam question number: #1
Time: 3 hours
We need a program to help teacher calculate the average mark
of trainee in class as followings:
1. Create data file in plain text format including fields:
Trainee’s Name,Math,Lite,Eng,His and Phy. Require at
least 15 records. (1 mark)
For example:
2. Write a C++ program to do:
- Load content of data file to array of trainee pointers (3
marks).
For example:
- Show program menu (1 mark)
Note: You should validate input when use press
‘1’,’2’,’q’ or‘Q’. Otherwise, program displays error
message “Please choice ‘1’,’2’,’q’ or ‘Q’”.
- Display mark table (print all trainees of data file that
loaded in to memory). (2 marks).
- Display top 5 trainees by average mark. The average mark
= (Math + Lite + Eng+ His +Phy)/5. (3 marks).
For example:
Common requirement:
- Using pointer to store each record in the memory. You
have to release allocated resource after use (free memory
when program terminal).
- Deliverable including binary (execute file), source files
and data file. (in ZIP format)