Write 5 5 classes on exams in C #, exam information management

Source: Internet
Author: User

2. Exam Information Management

(1) Using the console program to do the interface

(2) Create at least 5 exam-related classes

(3) Completion of the test results of input, statistics and other functions

(4) test requirements: The object-oriented features used in the test program.

<span style= "Font-size:32px;color: #ff0000;" >1. Main function </span>using system;using system.collections.generic;using system.linq;using System.Text;using        System.threading.tasks;namespace testmanage{public class Program {public static void Main (string[] args)           {Menu me = new Menu ();           Me.caidan ();        Console.ReadLine (); }}}<span style= "Font-size:32px;color: #ff0000;" >2. First Class menu class </span>using system;using system.collections.generic;using system.linq;using System.Text;using System.threading.tasks;namespace testmanage{public class Menu {public void Caidan () {in Put PU = new input ();//Score Entry Maxscore ms = new Maxscore ();//maximum score per course minscore mi = new Minscore ();//each course Min. everyavg av = new Everyavg ()//average allavg al = new Allavg per course;//average score Allavgorder for total courses AO = new Allavgorder ();//Average sorting by total course show sh = new show ();//show the results of each section foR (int m = 0;; m++) {Console.WriteLine ("Student performance statistics");            Console.WriteLine ("=========================================");            Console.WriteLine ("1. Score entry");            Console.WriteLine ("2. Maximum score per course");            Console.WriteLine ("3. Minimum of each course");            Console.WriteLine ("4. Average of each course");            Console.WriteLine ("5. Average of the total course");            Console.WriteLine ("6. Average by total course");            Console.WriteLine ("7. Show the results of each section");            Console.WriteLine ("8. Exit");                Console.WriteLine ("=========================================");                Console.WriteLine ("Please enter the item number you want to execute:"); int k = Int.                Parse (Console.ReadLine ());                if (k = = 8) {break;}                        else {switch (k) {case 1:pu.luru ();                          Case 2:  Console.clear (); Ms.max ();                        Break                            Case 3:console.clear (); Mi.min ();                        Break                            Case 4:console.clear (); Av.avg ();                        Break                            Case 5:console.clear (); Al.allavg ();                        Break                            Case 6:console.clear (); Ao.allavgpaixu ();                        Break                            Case 7:console.clear (); Sh.xianshi ();                    Break }}}}}}<span style= "Font-size:32px;color: #ff0000;" >3. Score Entry class </span>using system;using system.collections.generic;using system.linq;using System.Text;using System.threading.tasks;namespace testmanage{public class Input {public static int N { Get Set        } public static int F {get; set;}        public static double[] Allavg2 {get; set;}        public static double[,] score {get; set;}            Public Input () {N = 2;//number F = number of 3;//lessons ALLAVG2 = new Double[n];        Score = new Double[n, F]; } public void Luru ()//Input function {for (int i = 0; i < N; i++) {Consol                E.writeline ("Please enter" + (i + 1) + "Students ' scores of three classes"); for (int j = 0; J < F; J + +) {score[i, j] = Double.                Parse (Console.ReadLine ()); }}}}}<span style= "Font-size:32px;color: #ff0000;" >4. Maximum classification of each course </span>using system;using system.collections.generic;using system.linq;using System.Text;using            System.threading.tasks;namespace testmanage{public class Maxscore:input {public void Max () {              for (int j = 0; J < F; J + +) {  int max = 0;                    for (int k = 0; k < N-1; k++) {if (Score[max, J] < Score[k + 1, j])                    {max = k + 1;            }} Console.WriteLine ("Course" + (j + 1) + "Max divided by" + Score[max, j]); }}}}<span style= "Font-size:32px;color: #ff0000;" >5. Minimum classification for each course </span>using system;using system.collections.generic;using system.linq;using System.Text;using            System.threading.tasks;namespace testmanage{public class Minscore:input {public void min () {                for (int j = 0; J < F; J + +) {int min = 0;                    for (int k = 0; k < N-1; k++) {if (Score[min, J] > Score[k + 1, j])                    {min = k + 1;       }} Console.WriteLine ("Course" + (j + 1) + "minimum divided into" + Score[min, j]);     }}}}<span style= "Font-size:32px;color: #ff0000;" >6. Classification of each course </span>using system;using system.collections.generic;using system.linq;using System.Text;using            System.threading.tasks;namespace testmanage{public class Everyavg:input {public void avg () {            Double sum = 0, avg; for (int j = 0, J < F, J + +) {for (int k = 0; k < N; k++) {sum = sum + SCO Re[k, j];                } avg = sum/n;                sum = 0;            Console.WriteLine ("Course" + (j + 1) + "average divided" + avg); }}}}<span style= "Font-size:32px;color: #ff0000;" >7. Average class </span>using system;using system.collections.generic;using system.linq;using System.Text;using            System.threading.tasks;namespace testmanage{public class Allavg:input {public void Allavg () {            Double sum = 0; for (int j = 0; J < N; J + +) {for (iNT k = 0; K < F;                k++) {sum = sum + score[j, K];}                ALLAVG2[J] = sum/f;            sum = 0; } for (int k = 0; k < k++) {try {CONSOLE.W                Riteline ("The school number is" + (k + 1) + "The average score is" + allavg2[k]); } catch (Exception ex) {}}}}}<span style= "Font-size:32px;color: #f f0000; " >8. Average sorting class </span>using system;using system.collections.generic;using system.linq;using System.Text by total course; Using System.threading.tasks;namespace testmanage{public class Allavgorder:input {public void Allavgpaixu                () {for (int j = 0; J < 9; J + +) {for (int k = 0; k < 9-j; k++)                        {try {if (Allavg2[k] < Allavg2[k + 1])      {Double temp;                      temp = Allavg2[k];                            Allavg2[k] = allavg2[k + 1];                        Allavg2[k + 1] = temp; }} catch (Exception ex) {}}} Conso Le.            WriteLine ("Ranking of average scores"); for (int j = 0; J <; J + +) {try {Console.WriteLine (alla                VG2[J]); } catch (Exception ex) {}}}}}<span style= "Font-size:32px;color: #ff0000;" >9. Show each section achievement class </span>using system;using system.collections.generic;using system.linq;using System.Text;using            System.threading.tasks;namespace testmanage{public class Show:input {public void Xianshi () {            Console.WriteLine ("Study No. 1 Course 2 Course 3"); for (int j = 0; J <; J + +) {try {Console.WriteLine (j +"+ score[j, 0] +" "+ score[j, 1] +" "+ Score[j, 2]); } catch (Exception ex) {Console.WriteLine (ex. Message); }            }        }    }}


Write 5 5 classes on exams in C #, exam information management

Related Article

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.