这是一张作业贴~有人想帮帮忙吗~~~呜呜~
Assume that a file, named discussion_record.txt, contains 20 WebCT discussion records (you can download it from WebCT.) The attributes in one discussion record include the record ID, student ID, Name, Age, reply number, topic. For example,1 001d John 18 1 DataType
2 002d Mary 18 3 Expression
……..
Functional Requirements: (50 marks)
Design and implement a program to perform the following functions.
1. (5 marks) Read the discussion records from the file and show them on the screen in the following format:
001 001d John 18 1
002 002d Mary 19 2
………
2. (5 marks) Display a discussion record on the screen according to the record ID input by the user.
3. (10 marks) Allow a user to find a discussion record by specifying the record ID and then modify the reply number. After the modification, the updated record should be written into the file discussion_record.txt.
4. (15 marks) Sort the discussion records in decreasing order, according to the reply number. Print the sorted discussion records on the screen
5. (15 marks) Make statistic of the number of discussion records created by every student and show the result on the screen in the following format:
John 7
Mary 5
Lilei 8
Implementation Requirements: (30 marks)
1. (5 marks) Use an array of struct to read the discussion records from the file discussion_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 example 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 discussion records” is corresponding to the function print_all_records(). Another example is the operation of “update a discussion record” which is corresponding to the function update_record ().