• 大小: 38KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-10
  • 语言: C#
  • 标签:

资源简介

该资源是在C#语言下,控制台程序下,进行学生信息录入,包括学号、姓名、第一门成绩、第二门成绩、第三门成绩、,可以查询、删除、修改、计算三门平均成绩等功能

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MyProject4
{
    class Program
    {
        public static Student[] stu;//定义Student类型的数组,用来存放数据
        public static int count = 0;  //记录存入数量
        static void Main(string[] args)
        {
            //定义一个学生数组类 ,保存50个数组
            stu = new Student[50];
            int Choose = 0;            
            do
            {
                
                Console.WriteLine(“===============================================================“);
                Console.WriteLine(“\t0.退出信息\t1.录入信息\t2.浏览信息“);
                Console.WriteLine(“\t3.信息排序\t4.插入信息\t5.删除信息“);
                Console.WriteLine(“\t6.查询信息\t7.修改信息\t8.清屏“);
                Console.WriteLine(“^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^“);

                Console.Write(“请选择功能:“);
               
                try
                {
                    Choose = int.Parse(Console.ReadLine());
                }
                catch
                {
                    Console.WriteLine(“输入错误! “);
                }
                switch (Choose)
                {
                    case 0:
                        try
                        {
                             Environment.Exit(0);
                        }
                        catch (Exception ex)
                        {
                             Console.WriteLine(ex.Message);
                        } break;
                    case 1:
                         try
                        {
                             Console.Clear();                                                    
                             InsertStudent(stu);                                                                                           
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine(ex.Message);
                        }
                        break;
                    case 2://浏览方法;
                        try
                        {
                            if (count!= 0)
                            {
                                Show(stu);
                            }
                            else
                                Console.WriteLine(“没有数据可供浏览“);
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine(ex.Message);
                        }
                        break;
                    case 3://信息排序方法;
                        try
                        {
                            if (count != 0)
                            {
                                Console.WriteLine(“1.按学号排序\t2.按平均成绩排序“);
                                int i = int.Parse (Console.ReadLine());
                                if (i == 1)

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      10752  2011-07-14 10:58  冯永亮\MyProject4\MyProject4\bin\Debug\MyProject4.exe

     文件      32256  2011-07-14 10:58  冯永亮\MyProject4\MyProject4\bin\Debug\MyProject4.pdb

     文件      14328  2011-07-14 10:59  冯永亮\MyProject4\MyProject4\bin\Debug\MyProject4.vshost.exe

     文件        490  2007-07-21 01:33  冯永亮\MyProject4\MyProject4\bin\Debug\MyProject4.vshost.exe.manifest

     文件       2568  2011-07-13 14:41  冯永亮\MyProject4\MyProject4\MyProject4.csproj

     文件        692  2011-07-14 10:59  冯永亮\MyProject4\MyProject4\obj\Debug\MyProject4.csproj.FileListAbsolute.txt

     文件      10752  2011-07-14 10:58  冯永亮\MyProject4\MyProject4\obj\Debug\MyProject4.exe

     文件      32256  2011-07-14 10:58  冯永亮\MyProject4\MyProject4\obj\Debug\MyProject4.pdb

     文件      16856  2011-07-14 10:57  冯永亮\MyProject4\MyProject4\Program.cs

     文件       1360  2011-07-13 14:04  冯永亮\MyProject4\MyProject4\Properties\AssemblyInfo.cs

     文件        858  2011-07-13 15:29  冯永亮\MyProject4\MyProject4\School.cs

     文件       1970  2011-07-14 10:58  冯永亮\MyProject4\MyProject4\Student.cs

     文件        920  2011-07-13 14:04  冯永亮\MyProject4\MyProject4.sln

    ..A..H.     14848  2011-07-14 10:59  冯永亮\MyProject4\MyProject4.suo

     目录          0  2011-07-14 09:04  冯永亮\MyProject4\MyProject4\obj\Debug\TempPE

     目录          0  2011-07-14 09:04  冯永亮\MyProject4\MyProject4\bin\Debug

     目录          0  2011-07-14 09:48  冯永亮\MyProject4\MyProject4\obj\Debug

     目录          0  2011-07-14 09:04  冯永亮\MyProject4\MyProject4\bin

     目录          0  2011-07-14 09:04  冯永亮\MyProject4\MyProject4\obj

     目录          0  2011-07-14 09:04  冯永亮\MyProject4\MyProject4\Properties

     目录          0  2011-07-14 09:48  冯永亮\MyProject4\MyProject4

     目录          0  2011-07-14 09:04  冯永亮\MyProject4

     目录          0  2011-07-14 09:04  冯永亮

----------- ---------  ---------- -----  ----

               140906                    23


评论

共有 条评论

相关资源