Khoá học lập trình C/C++ Dành cho người mới bắt đầu Quản lý sinh viên 2 - Assigment - Lập trình C
- 5.0/5.0
- 2k Đăng ký
- Học lập trình
- Tiếng việt
Thông tin khóa học
1. Data
Declare a structure:
struct student_st {
char fullname[30];
char rollNo[10];
int year;
float mark;
};
In the main() function, declare an array of 3 students named studentList.
2. Menu-Based Program
Create a menu-driven program with the following options:
-
Input student data
-
Sort, display detailed information, and show statistics of all students
-
Find students by year of birth
-
Save to binary file
student.dat -
Exit
3. Input Student Data
When the user chooses option 1, perform the following:
Example:
Enter data of student 1:
Full name: Nguyen Van An
Roll Number: C1101h2398
Year of birth: 1991
Mark (/10): 7
This module must be implemented in a separate function that:
-
Has a
student_ststruct pointer as an argument. -
Stores the input data into the
studentListarray in themain()function.
4. Sort, Display Information, and Statistics
When the user chooses option 2:
-
Sort students in descending order by mark.
-
Display detailed information of each student in the following format:
No || Name || Roll Number || Year || Mark || Status ||
001 || Nguyen Van An || C1101h2398 || 1991 || 7.00 || CREDIT ||
002 || Vu Van Binh || C1010h2511 || 1990 || 6.50 || CREDIT ||
003 || Do Thanh Hai || C1105i0125 || 1992 || 2.50 || FAIL ||
Display the number of students by status, for example:
CREDIT has 2 students
FAIL has 1 student
Status is defined based on mark:
-
≥ 7.5 → DISTINCTION
-
≥ 6.0 → CREDIT
-
≥ 4.0 → PASS
-
< 4.0 → FAIL
This module must be implemented in a separate function that:
-
Has a
student_ststruct array as an argument.
5. Find Student by Year of Birth
When the user chooses option 3:
-
Display:
Enter year for search: -
Find and display detailed information of students with the entered year of birth (using the same format as in section 4).
-
If no student is found, display:
There are no students with this year of birth.
This module must be implemented in a separate function that:
-
Has a
student_ststruct array as an argument.
6. Save to Binary File
When the user chooses option 4:
-
Save all student information to a binary file named
student.dat.
This module must be implemented in a separate function that:
-
Has a
student_ststruct pointer as an argument. -
Creates the file
student.datin binary mode. -
Writes all student data to the file.
-
Closes the file.
7. Exit
When the user chooses option 5, the program terminates.
Đăng nhập để làm bài kiểm tra
Chưa có kết quả nào trước đó
Chương trình
Nguyễn Văn An
Trần Thị Bích
Lê Hoàng Hải
Phạm Minh Tuấn
Đánh giá
B2. Đăng ký học
B3. Hoàn thành mua khoá học
B4. Thanh toán theo hướng dẫn
B5. Đợi chúng tôi kiểm tra thông tin và thêm bạn vào lớp học
Bước 1: Truy cập website https://gozic.vn/teacher/form
Bước 2: Điền thông tin theo yêu cầu. Để bản đăng ký được duyệt nhanh nhất, anh chị hãy điền đủ thông tin nhé.
Bước 3: Click vào "đăng ký ngay" để hoàn thành
Lưu ý:
Link video bài giảng mẫu: Video bài giảng mẫu là căn cứ để Trắc Nghiệm Việt duyệt về hình thức và chất lượng giảng dạy. Vì vậy anh chị hãy điền link này để đăng ký được duyệt nhanh nhất nhé.
Anh chị cũng nên mô tả kỹ về kinh nghiệm giảng dạy để Trắc Nghiệm Việt đánh giá nhé.
Chúc các anh chị và các bạn thành công, sớm gia nhập đội ngũ giảng viên Trắc Nghiệm Việt!
200,000 VNĐ
999,000 VNĐ
Tổng quan khóa học
- Bài học 62
- Thời gian Linh hoạt
- Mức độ Mới bắt đầu
- Ngôn ngữ Tiếng việt
- Chứng chỉ Không
Trần Văn Điệp
Founder tại QViet.vn