| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 381 人关注过本帖
标题:[求助] 一道运用结构体的变成题目
只看楼主 加入收藏
kailun
Rank: 1
等 级:新手上路
帖 子:22
专家分:0
注 册:2006-11-21
收藏
 问题点数:0 回复次数:0 
[求助] 一道运用结构体的变成题目

Assume that a file, named stud_record.txt, contains 5 - 20 students’ records (you can download it from Webct.) The attributes in one student’s record includes the student’s ID, Name, Age, Mark, in sequence. For example,
001d, John, 18, 92
002d, Mary, 18, 93
……..
Design and implement a program to perform the following functions.
1. (5 marks) Read the students’ records from the file and show them on the screen in the following format:
001d, John, 18, 92
002d, Mary, 19, 93
………
2. (5 marks) Calculate the average grade of the students recorded in file stud_record.txt
3. (15 marks) Sort the students records in decreasing order, according to the marks of students. Print the sorted students’ records on the screen and into a file, namely stud_ranking.txt.
4. (10 marks) Display a student’s record on the screen according to the student’s ID input by the user.
5. (15 makrs) allow a user to first find a student’s record by specifying the student’s ID and then modify the student’s age and mark. After the modification, the updated record should be written into the file stud_record.txt.
Requirements:
1. (5 marks) Use an array of struct to read the students’ records from the file stud_record.txt and use this array to perform all the operations in the program.
2. (15 marks) Provide a text menu for users to select the operations. An examples is given below.


3. (5 marks) Use the Switch and Case statements to implement the menu function.
4. (5 marks) Develop a function for every operations in the menu. For example, the operation of “printing all students’ records” is corresponding to the function print_all_students(). Another example is the operation of “update a student’s record” which is corresponding to the function update_record ().

How to submit
Please submit a source file, named Fabo.c, for Question 1, and s a source file, named Student.c, for Question 2. Compress the two files into a .zip or .rar package, with your student ID as . Then, submit the compressed package via WebCT.


搜索更多相关主题的帖子: 结构体 
2007-03-21 21:25
快速回复:[求助] 一道运用结构体的变成题目
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.013713 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved