Practice--Student Information entry

Source: Internet
Author: User

Machine Test topic: 1. Enter information for 3 students: Student number, name, five course results (Chinese, maths, English, Chemistry, physics), the highest score of the minimum score and the average score of the output students, if there is a failure, the output of their subjects and results. 2. Write a program to achieve a Grand Prix site score. A total of 10 judges scored, up to 100 points, minus a maximum score and a minimum score after the average score is the final score. Ask the user to enter the jury name and the score given by the jury, and then indicate which judges scored the highest, the highest score, which judges scored the lowest, the lowest score, and finally removed the highest score and the lowest score to calculate the final average score. 3. Programming as follows: I. Language and environment A, implementation technology: C#B, environmental requirements: MicrosoftVisual Studio 2012. Second, requirements: specific requirements: A. The information of 10 students is recorded from the console with the results (student number, name, C language score) using the structure.

B Print the total and average scores of the class in the console and print the highest and lowest scores of students

C Print the class score book and discharge the rank according to the high and low grade

Code:

namespacewww{classProgram {structStudent { Public stringCode;  Public stringname;  Public decimaldegree; }        Static voidMain (string[] args) {Console.Write ("Please enter the number of people:"); intn =int. Parse (Console.ReadLine ().            ToString ()); decimalSumfen =0, Avg =0, max =0, Min =0; Student[]sumstu=NewStudent[n]; //cyclic entry According to the number of people entered             for(inti =0; I < n; i++) {Console.WriteLine ("Please enter section"+ (i+1)+"A student's information"); Console.WriteLine ("study number name C language score, separated by tab key"); strings =Console.ReadLine (); string[] Sarr = S.split (New Char[]{'\ t'});//use split to separate by delimiterSumstu[i].code=sarr[0]; Sumstu[i].name=sarr[1]; Sumstu[i].degree=decimal. Parse (sarr[2]); Sumfen+=Sumstu[i].degree; } Console.WriteLine ("*****************************************************"); Console.WriteLine ("Total Score:"+Sumfen.            ToString ()); Avg= Sumfen/N; Console.WriteLine ("Average score:"+avg.            ToString ()); //Bubble Sort             for(inti =0; I < n-1; i++)            {                 for(intj = i +1; J < N; J + +)                {                    if(Sumstu[i].degree <Sumstu[j].degree) {Student Zhong=Newstudent (); Zhong=Sumstu[i]; Sumstu[i]=Sumstu[j]; SUMSTU[J]=Zhong; }}} Console.WriteLine ("Highest score:"+sumstu[0].degree.            ToString ()); Console.WriteLine ("Minimum Score:"+sumstu[n-1].degree.            ToString ()); Console.WriteLine ("the results of this class are listed below:"); Console.WriteLine ("*************************************************"); Console.WriteLine ("Rank"+"\ t"+"School Number"+"\ t"+"name"+"\ t"+"Achievements");  for(inti =1; I <= N; i++) {Console.WriteLine (i+"\ t"+sumstu[i-1].code+"\ t"+sumstu[i-1].name+"\ t"+sumstu[i-1].degree);        } console.readline (); }    }}

Practice--Student Information entry

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.