帮忙修改一下
定义一个学生类,该类的功能如下:包含学生的姓名、性别、年龄、学号、Csharp课程成绩、Java课程成绩,在类中设计一个变量来记录共有多少学生,即共为该类生产多少个实例:具有可输出生产实例个数的成员函数;具有可输入/输出学生信息的成员函数;具有可计算学生总分和平均分的成员函数。using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Student
{
class Student
{
public static int num;
int no;
string name;
string sex;
int age;
double csharp;
double java;
public int No
{
get { return no; }
set { no = value; }
}
public string Name
{
get { return name; }
set { name = value; }
}
public string Sex
{
get { return sex; }
set { sex = value; }
}
public int Age
{
get { return age; }
set { age = value; }
}
public double Csharp
{
get { return csharp; }
set { csharp = value; }
}
public double Java
{
get { return java; }
set { java = value; }
}
//public int Num()
//{
// num=
//}
public void input()
{
}
public double Sum()
{
double sum;
sum = csharp + java;
return sum;
}
public double Avg()
{
double avg;
avg = (csharp + java) / 2;
return avg;
}
}
class Program
{
static void Main(string[] args)
{
Student s = new Student();
string x;
int i = 1, j = 0;
Console.WriteLine(" 学生信息管理系统");
Console.WriteLine("--------------------------");
Console.WriteLine("请输入学生的信息");
Console.WriteLine("--------------------------");
do
{
Console.Write("学号:");
no = Convert.ToInt32(Console.ReadLine());
Console.Write("姓名:");
name = Console.ReadLine();
Console.Write("性别:");
sex = Console.ReadLine();
Console.Write("年龄:");
age = Convert.ToInt32(Console.ReadLine());
Console.Write("c#成绩:");
csharp = Convert.ToDouble(Console.ReadLine());
Console.Write("java成绩:");
java = Convert.ToDouble(Console.ReadLine());
Console.WriteLine("还需要输入学生信息吗(yes/no)");
x = Console.ReadLine();
} while (x == "yes");
Console.WriteLine("现在共有学生" + (i - 1) + "名");
Console.WriteLine("\n--------------------------------------------------------------\n");
Console.WriteLine("学号\t姓名\t性别\t年龄\tc#成绩\tjava成绩\t总成绩\t平均成绩");
for (j = 0; j < (i - 1); j++)
{
Console.WriteLine("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t\t{6}\t{7}", s.No, s.Name, s.Sex, s.Age, s.Csharp, s.Java, s.Sum(), s.Avg());
}
Console.ReadLine();
}
}
}