{"trustable":false,"sections":[{"title":"","value":{"format":"PLAIN","content":"Hi, I am an undergraduate student in institute of foreign languages. As you know, C programming is a required course in our university, even if his/her major is far from computer science. I don\u0027t like this course at all, as I am not good at computer and I don\u0027t wanna even have a try of any programming!!But I have to do the homework in order to pass :( Sh... Could you help me with it? Please keep secret!!I know that you won\u0027t say NO to a poor little girl, boy. :)\n\nTask\n\nWrite a Student Performance Management System (SPMS).\n\nConcepts\n\nIn the SPMS, there will be at most 100 students, each has an SID, a CID, a name and four scores(Chinese, Mathematics, English and Programming).\n\nSID (student ID) is a 10-digit number\n\nCID (class ID) is a positive integer not greater than 20.\n\nName is a string of no more than 10 letters and digits, beginning with a capital letter. Note thata name cannot contain space characters inside.\n\nEach score is a non-negative integer not greater than 100.\n\nMain Menu\n\nWhen you enter the SPMS, the main menu should be shown like this:\n\nWelcome to Student Performance Management System (SPMS).\n\n1 - Add\n2 - Remove\n3 - Query\n4 - Show ranking\n5 - Show Statistics\n0 - ExitAdding a Student\n\nIf you choose 1 from the main menu, the following message should be printed on the screen:\n\nPlease enter the SID, CID, name and four scores. Enter 0 to finish.\n\nThen your program should wait for user input. The input lines are always valid (no invalid SID,CID, or name, exactly four scores etc), but the SID may already exist. In that case, simply ignore thisline and print the following:\n\nDuplicated SID.\n\nOn the other hand, multiple students can have the same name.You should keep printing the message above until the user inputs a single zero. After that the mainmenu is printed again.\n\nRemoving a Student\n\nIf you choose 2 from the main menu, the following message should be printed on the screen:\n\nPlease enter SID or name. Enter 0 to finish.\n\nThen your program should wait for user input, and remove all the students matching the SID or name in the database, and print the following message (it\u0027s possiblexx\u003d 0):\n\nxx student(s) removed.\n\nYou should keep printing the message above until the user inputs a single zero. After that the main menu is printed again.\n\nQuerying Students\n\nIf you choose 3 from the main menu, the following message should be printed on the screen:\n\nPlease enter SID or name. Enter 0 to finish.\n\nThen your program should wait for user input. If no student matches the SID or name, simply do nothing, otherwise print out all the matching students, in the same order they\u0027re added to the database.The format is similar to the input format for \\adding a student\", but 3 more columns are added:rank(1st column),total score and average score (last two columns). The student with highest total score(considering all classes) received rank 1, and if there are two rank - 2 students, the next one would be rank - 4.\n\nYou should keep printing the message above until the user inputs a single zero. After that the mainmenu is printed again.\n\nShowing the Ranklist\n\nIf you choose 4 from the main menu, the following message should be printed on the screen:\n\nShowing the ranklist hurts students\u0027 self-esteem. Don\u0027t do that.\n\nThen the main menu is printed again.\n\nShowing Statistics\n\nIf you choose 5 from the main menu, show the statistics, in the following format:\n\nPlease enter class ID, 0 for the whole statistics.\n\nWhen a class ID is entered, print the following statistics. Note that\"passed\"means to have a scoreof at least 60.\n\nChinese\n\nAverage Score:xx.xx\nNumber of passed students:xx\nNumber of failed students:xx\nMathematicsAverage Score:xx.xx\nNumber of passed students:xx\nNumber of failed students:xx\nEnglishAverage Score:xx.xx\nNumber of passed students:xx\nNumber of failed students:xx\nProgrammingAverage Score:xx.xx\nNumber of passed students:xx\nNumber of failed students:xx\nOverall:Number of students who passed all subjects:xx\nNumber of students who passed 3 or more subjects:xx\nNumber of students who passed 2 or more subjects:xx\nNumber of students who passed 1 or more subjects:xx\nNumber of students who failed all subjects:xx\n\nThen, the main menu is printed again.\n\nExiting SPMS\n\nIf you choose 0 from the main menu, the program should terminate.\nNote that course scores and total score should be formatted as integers, but average scores shouldbe formatted as a real number with exactly two digits after the decimal point.\n\n你好,我是外国语学院的一名本科生。如你所知,C语言编程是我们大学的一门必修课,即使他/她的专业离计算机科学很远。 我一点也不喜欢这门课,因为我不擅长计算机,我甚至不想尝试任何编程!!但我必须做作业才能通过:( Sh...... 你能帮我吗?请保密!!我知道你不会对一个可怜的小女孩说NO,男孩。)\n\n任务\n\n编写一个学生成绩管理系统(SPMS)。\n\n概念\n\n在SPMS中,最多有100个学生,每个学生有一个SID,一个CID,一个名字和四个分数(中文、数学、英语和程序设计),SID(学生ID)是一个10位数的数字,CID(班级ID)是一个不大于20的正整数。\n\nSID(学生ID)是一个10位数的数字。\n\nCID(类ID)是不大于20的正整数。\n\n名称是一个不超过10个字母和数字的字符串,以大写字母开头。注意名称中不能包含空格字符。\n\n每个分数是不大于100的非负数。\n\n主菜单\n\n当你进入SPMS后,主菜单应该是这样显示的。\n\n欢迎来到学生成绩管理系统(SPMS)。\n\n1 - 添加\n2 - 移除\n3 - 查询\n4 - 显示排名\n5 - 显示统计数据\n0 - 退出添加一个学生\n\n如果您从主菜单中选择1,屏幕上应打印出以下信息。\n\n请输入SID、CID、姓名和4个分数。输入0完成。\n\n然后您的程序应该等待用户输入。输入的行总是有效的(没有无效的SID,CID,或名称,正好是四个分数等),但SID可能已经存在。在这种情况下,只需忽略这一行,并打印以下内容。\n\n重复的SID\n\n另一方面,多个学生可以有相同的名字.你应该继续打印上面的信息,直到用户输入一个零。在这之后,主菜单又被打印出来。\n\n移除一个学生\n\n如果您从主菜单中选择2,屏幕上应打印以下信息。\n\n请输入SID或姓名,输入0完成。输入0完成。\n\n然后你的程序应该等待用户输入,并删除数据库中所有与SID或姓名相匹配的学生,并打印以下信息(有可能xx\u003d0)。\n\nxx学生被删除。\n\n你应该一直打印上面的信息,直到用户输入一个0。之后再打印主菜单。\n\n查询学生\n\n如果您从主菜单中选择3,屏幕上应打印以下信息。\n\n请输入SID或名称 输入0完成。\n\n然后您的程序应该等待用户输入。如果没有符合SID或姓名的学生,则不做任何操作,否则将所有符合条件的学生按照他们被添加到数据库中的顺序打印出来,格式与 \"添加学生 \"的输入格式相似,但多了3列:排名(第1列),总分和平均分(最后两列)。总分最高的学生(考虑到所有班级)获得排名1,如果有两个排名-2的学生,下一个就是排名-4的学生。\n\n你应该继续打印上面的信息,直到用户输入一个零。之后再打印主菜单。\n\n显示排名列表\n\n如果你从主菜单中选择4,屏幕上应该打印出以下信息。\n\n显示排名表 伤害学生的自尊。不要这样做。\n\n然后再次打印主菜单。\n\n显示统计数据\n\n如果从主菜单中选择5,显示统计,格式如下。\n\n请输入班级ID,0代表全部统计。\n\n当输入班级ID后,打印以下统计数据。注意,\"合格 \"是指成绩在60分以上。\n\n中文成绩\n\n平均分:xx.xx\n合格人数:xx\n不合格学生人数:xx\n数学平均分:xx.xx分\n合格学生人数:xx\n不合格学生人数:xx\n英语平均分:xx.xx分。\n合格学生人数:xx\n不合格学生人数:xx\n程式設計平均分:xx.xx分\n合格学生人数:xx\n不合格学生人数:xx\n整體:通過所有科目的學生人數:xx人\n通過3科或以上的學生人數:xx人\n通過2科或以上的學生人數:xx。\n1科或以上及格的學生人數:xx人\n所有科目不合格的学生人数:xx。\n\n然后,再次打印主菜单。\n\n退出SPMS\n\n如果你从主菜单中选择0,程序应该终止。\n请注意,课程分数和总分应该用整数格式化,但平均分数应该用实数格式化,小数点后正好有两位数。"}},{"title":"Input","value":{"format":"PLAIN","content":"There will be a single test case, ending with a zero entered in the main menu screen. The entire input will be valid. The size of input does not exceed 10KB.\n\n将有一个单一的测试案例,在主菜单屏幕上以零输入结束。整个输入将是有效的.输入的大小不超过10KB.Output打印出问题描述中所说的一切。输入的大小不超过10KB。"}},{"title":"Output","value":{"format":"PLAIN","content":"Print out everything as stated in the problem description. You should be able to play around this little program in your machine, with a keyboard and a screen. However, both the input and output maylook silly when they\u0027re not mixed, as in the keyboard-screen case.\n\nHint:\n\nWhen formatting a oating-point number such as AverageScore, a good way to prevent floating-point errors is to add a small number (like 1e-5 in this problem). Otherwise, 80.315 would be printedas 80.31 if the floating-point error makes it 80.31499999...\n\n\n\n\n打印出问题描述中所说的一切。你应该可以在你的机器上玩转这个小程序,有键盘和屏幕。然而,当它们不混合时,输入和输出都可能看起来很傻,就像在键盘-屏幕的情况下。\n\n提示。\n\n当格式化诸如AverageScore这样的浮点数时,防止浮点错误的一个好办法是加一个小数(如本题中的1e-5)。否则,80.315将被打印成80.31,如果浮点错误使其成为80.31499999......。\n\n\n"}},{"title":"Sample Input","value":{"format":"PLAIN","content":"1\n0011223344 1 John 79 98 91 100\n0022334455 1 Tom 59 72 60 81\n0011223344 2 Alice 100 100 100 100\n2423475629 2 John 60 80 30 99\n0\n3\n0022334455\nJohn\n0\n5\n1\n2\n0011223344\n0\n5\n0\n4\n0\n"}},{"title":"Sample Output","value":{"format":"PLAIN","content":"Welcome to Student Performance Management System (SPMS).\n1 - Add\n2 - Remove\n3 - Query\n4 - Show ranking\n5 - Show Statistics\n0 - Exit\nPlease enter the SID, CID, name and four scores. Enter 0 to finish.\nPlease enter the SID, CID, name and four scores. Enter 0 to finish.\nPlease enter the SID, CID, name and four scores. Enter 0 to finish.\nDuplicated SID.Please enter the SID, CID, name and four scores.\nEnter 0 to finish.Please enter the SID, CID, name and four scores.\nEnter 0 to finish.Welcome to Student Performance Management System (SPMS).\n\n1 - Add\n2 - Remove\n3 - Query\n4 - Show ranking\n5 - Show Statistics\n0 - Exit\n\nPlease enter SID or name. Enter 0 to finish.\n2 0022334455 1 Tom 59 72 60 81 272 68.00\nPlease enter SID or name. Enter 0 to finish.\n1 0011223344 1 John 79 98 91 100 368 92.00\n3 2423475629 2 John 60 80 30 99 269 67.25\nPlease enter SID or name. Enter 0 to finish.\nWelcome to Student Performance Management System (SPMS).\n\n1 - Add\n2 - Remove\n3 - Query\n4 - Show ranking\n5 - Show Statistics\n0 - Exit\n\nPlease enter class ID, 0 for the whole statistics.\nChineseAverage Score: 69.00\nNumber of passed students: 1\nNumber of failed students: 1\nMathematicsAverage Score: 85.00\nNumber of passed students: 2\nNumber of failed students: 0\nEnglishAverage Score: 75.50\nNumber of passed students: 2\nNumber of failed students: 0\nProgrammingAverage Score: 90.50\nNumber of passed students: 2\nNumber of failed students: 0\nOverall:Number of students who passed all subjects: 1\nNumber of students who passed 3 or more subjects: 2\nNumber of students who passed 2 or more subjects: 2\nNumber of students who passed 1 or more subjects: 2\nNumber of students who failed all subjects: 0\nWelcome to Student Performance Management System (SPMS).\n\n1 - Add\n2 - Remove\n3 - Query\n4 - Show ranking\n5 - Show Statistics\n0 - Exit\n\nPlease enter SID or name. Enter 0 to finish.1 student(s) removed.\nPlease enter SID or name. Enter 0 to finish.\nWelcome to Student Performance Management System (SPMS).\n\n1 - Add\n2 - Remove\n3 - Query\n4 - Show ranking\n5 - Show Statistics\n0 - Exit\n\nPlease enter class ID, 0 for the whole statistics.\nChineseAverage Score: 59.50\nNumber of passed students: 1\nNumber of failed students: 1\nMathematicsAverage Score: 76.00\nNumber of passed students: 2\nNumber of failed students: 0\nEnglishAverage Score: 45.00\nNumber of passed students: 1\nNumber of failed students: 1\nProgrammingAverage Score: 90.00\nNumber of passed students: 2\nNumber of failed students: 0\nOverall:Number of students who passed all subjects: 0\nNumber of students who passed 3 or more subjects: 2\nNumber of students who passed 2 or more subjects: 2\nNumber of students who passed 1 or more subjects: 2\nNumber of students who failed all subjects: 0\nWelcome to Student Performance Management System (SPMS).\n\n1 - Add\n2 - Remove\n3 - Query\n4 - Show ranking\n5 - Show Statistics\n0 - Exit\n\nShowing the ranklist hurts students\u0027 self-esteem. Don\u0027t do that.\nWelcome to Student Performance Management System (SPMS).\n\n1 - Add\n2 - Remove\n3 - Query\n4 - Show ranking\n5 - Show Statistics\n0 - Exit"}}]}