4_6 Seniors Help (UVa12412) (optional)

Source: Internet
Author: User

Hello, I am an undergraduate in foreign Language College. As you know, programming is a compulsory course in our university, even if his/her major is away from computer science.  I do not like this course, because I am not good at computer, I do not want to have any programming attempt! But I have to do my homework: (Shh, can you help me?) Please keep it secret! I know you're not going to say no to a poor little girl. )

Task: Write a student performance management system (SPMS).

Concept: At SPMs, there will be a maximum of 100 students, each with a sid,cid, name and four courses (Chinese, maths, English and programming) scores.

sid (Student ID) is a 10-digit number.

CID (ID) is a positive integer not greater than 20.

• The name is a string, no more than 10 letters and numbers, beginning with uppercase letters. Note that the name cannot contain space characters.

• Each score is non-negative, not greater than 100.

Main Menu

When you enter SPMs, the main menu should look like this:

Welcome to Student Achievement Management System (SPMS).

1-add
2-remove
3-query
4-show ranking
5-show Statistics
0-exit

Increase student

If you select 1 from the main menu, the following information should be printed on the screen:

Please enter the SID, CID, name and four scores. Enter 0 to finish.

Then your program should wait for the user to enter. The input is always valid (invalid SID,
CID, name and score of four subjects), but Sid may already exist. In this case, you need to output a line of hints:

Duplicated SID.

On the other hand, multiple students can have the same name. You should keep the print message until the user enters a zero. Then print the main menu again.

Delete Student

If you choose 2 from the main menu, the following information should be printed on the screen

Please enter SID or name. Enter 0 to finish.

Then your program should wait for the user to enter and delete all students in the database that match the SID or name of all students, and print the following information (xx can be equal to 0):

XX student (s) removed.

You should always print the information above before the user enters a single 0. Then print the main menu again.

Query students

If you select 3 from the main menu, the following information should be printed on the screen:

Please enter SID or name. Enter 0 to finish.

Then your program should wait for the user to enter. If the student does not match the SID or the name, simply do nothing, otherwise, print out all matching students in the same command they added to the database.
This format is similar to the input format for "Add a student", but adds 3 columns: Rank (first column), total score, and average (the last two columns). The highest total score with the student (taking into account all classes) ranked − received 1, if there are two levels − 2 students, the next would be − ranked 4.
You should keep the print message until the user enters a zero. Then print the menu again.

4_6 Seniors Help (UVa12412) (optional)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.