C#学生成绩管理(控制台程序)

wudaoyin 2009-04-24 10:20:01
C#学生成绩管理(控制台程序)

功能:录入学生基本信息 如姓名,学号,各科成绩,输入各科成绩后就求各科成绩总分和平均分,做过的朋友帮帮忙,记得加上注释,偶是新手,谢谢。
...全文
1091 20 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
20 条回复
切换为时间正序
请发表友善的回复…
发表回复
waterstar50 2011-07-22
  • 打赏
  • 举报
回复
学习。。
  • 打赏
  • 举报
回复
记得加上注释。
fsh1985 2011-07-20
  • 打赏
  • 举报
回复
这个要自己动手,你才能学到
CJM175 2011-07-18
  • 打赏
  • 举报
回复
认真写习
weike021996 2011-07-18
  • 打赏
  • 举报
回复
学习学习学习学习学习学习学习
yongle1989 2011-07-18
  • 打赏
  • 举报
回复
谢谢,学习学习!
Fly_xinyijiu 2009-10-03
  • 打赏
  • 举报
回复
谢谢~
俩都看懂了~
suelu 2009-10-03
  • 打赏
  • 举报
回复
控制台程序适用你这个吗??
tanlijin 2009-10-03
  • 打赏
  • 举报
回复
这个不难,加油
piaomiaof 2009-10-03
  • 打赏
  • 举报
回复
路过学习学习
wudaoyin 2009-04-24
  • 打赏
  • 举报
回复
谢谢你的帮助。。
qq306850549 2009-04-24
  • 打赏
  • 举报
回复
你自己都把程序说的很明白了嘛..
为什么自己会写不出来呐...


多注意点思路..


OOP要学好
zy850919 2009-04-24
  • 打赏
  • 举报
回复

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

namespace Students
{
class Program
{
static void Main(string[] args)
{
Console.Write("请输入学生姓名:");
string Name = Console.ReadLine().ToString();
Console.Write("请输入学号:");
uint StudentID = uint.Parse(Console.ReadLine());
Console.Write("请输入一共要考几科");
uint SubjectsNO = uint.Parse(Console.ReadLine());
Console.WriteLine("请输入各科名称:");
string[] Subjects = new string[SubjectsNO];//装成绩的数组
for(int i=0;i<Subjects.Length;i++)
{
Subjects[i] = Console.ReadLine().ToString();
}
Console.Write("请输入各科分数:");
int[] Fractions= new int[SubjectsNO];//装分数的数组
for (int i = 0; i < Subjects.Length; i++)
{
Console.WriteLine("{0}", Subjects[i]);
Fractions[i] = int.Parse(Console.ReadLine());
}
Console.WriteLine("您输入的信息如下:");
Console.WriteLine("姓名:{0}",Name);
Console.WriteLine("学号:{0}",StudentID);
Console.WriteLine("一共考试科目是{0},科目和分数如下:",SubjectsNO);
for (int i = 0; i < Subjects.Length; i++)//显示科目和成绩
{
Console.WriteLine("{0}:{1}",Subjects[i],Fractions[i]);
}
Console.WriteLine("分数总和是:{0}", Fractions.Sum());//求和
Console.WriteLine("平均分数是:{0}", Fractions.Average());//求平均数
}
}
}



学程序要动手做。
深海之蓝 2009-04-24
  • 打赏
  • 举报
回复
太没诚意了啊。。。
wudaoyin 2009-04-24
  • 打赏
  • 举报
回复
对你们来说不难,对我来说就难了,谁帮忙给思路,或者帮忙将自己做过的这个控制台程序分享分享,小弟谢谢了。。。
xiangbupingfan 2009-04-24
  • 打赏
  • 举报
回复
这个不难,加油
wudaoyin 2009-04-24
  • 打赏
  • 举报
回复
就是不知道如何下手写,才求助大家的~!!有思路就好多了。。
xutao888 2009-04-24
  • 打赏
  • 举报
回复
新手更要自己写程序阿
mamoon 2009-04-24
  • 打赏
  • 举报
回复
沙发
xiangbupingfan 2009-04-24
  • 打赏
  • 举报
回复
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace XveJiGuanLi
{
public class XveSheng
{
private int _XveHao;
private string _XingMing;
private int _NianLing;
private string _XingBie;
private string _ZhuanYe;
public int _Count=0;

public XveSheng(int Count,int XveHao,string XingMing,string XingBie,int NianLing,string ZhuanYe)//构造函数
{
this._Count=Count;
this._XveHao = XveHao;
this._XingMing = XingMing;
this._XingBie = XingBie;
this._NianLing = NianLing;
this._ZhuanYe = ZhuanYe;
}

public static void PanDuan(XveSheng[] studentArray)//判断操作
{

string str = Console.ReadLine();
switch (str)
{
case "1": XveSheng.XiuGai();
break;
case "2": XveSheng.TianJia(studentArray);
break;
case "3": Console.WriteLine("输入删除学生的序号;");
XveSheng.ShanChu(studentArray);
break;
default:
break;
}

}


public static void XianShi(XveSheng[] studentArray)//显示学生属性表
{

Console.WriteLine(" 学生学籍管理系统");
Console.WriteLine("********************************************************************************");
Console.WriteLine("\t序号\t学号\t姓名\t性别\t年龄\t专业");
foreach (XveSheng s in studentArray)
{
Console.WriteLine("\t{0}\t{1}\t{2}\t{3}\t{4}\t{5}",s._Count,s._XveHao,s._XingMing,s._XingBie,s._NianLing,s._ZhuanYe);
}
Console.WriteLine("\n\t1.->>修改(未完成)\t2.->>添加\t3.->>删除");
//XveSheng.ShanChu(XveSheng[] studentArray);
}

public static void XiuGai()//修改操作
{
}

public static void TianJia(XveSheng[] studentArray)//添加操作
{
Console.WriteLine("输入添加的序号:");
string x = Console.ReadLine();
int xv=Convert.ToInt32(x);
Console.WriteLine("输入添加的学号;");
string x1 = Console.ReadLine();
int xve = Convert.ToInt32(x1);
Console.WriteLine("输入添加的姓名;");
string x2 = Console.ReadLine();
Console.WriteLine("输入添加的性别;");
string x3 = Console.ReadLine();
Console.WriteLine("输入添加的年龄:");
string x4 = Console.ReadLine();
int nian = Convert.ToInt32(x4);
Console.WriteLine("输入添加的专业");
string x5 = Console.ReadLine();
for (int i = 0; i < studentArray.Length; i++)
{
if (studentArray[i]._Count == 0)
{
studentArray[i]._Count = xv;
studentArray[i]._XveHao = xve;
studentArray[i]._XingMing = x2;
studentArray[i]._XingBie = x3;
studentArray[i]._NianLing = nian;
studentArray[i]._ZhuanYe = x5;
break;
}
}
XveSheng.XianShi(studentArray);
XveSheng.PanDuan(studentArray);
}

public static void ShanChu(XveSheng[] studentArray)//删除操作
{
int i = 0;
string x=Console.ReadLine();
i=Convert.ToInt32(x);
studentArray[i - 1]._Count=0;
studentArray[i - 1]._NianLing = 0;
studentArray[i - 1]._XingBie = "";
studentArray[i - 1]._XingMing = "";
studentArray[i - 1]._XveHao = 0;
studentArray[i - 1]._ZhuanYe = "";
XveSheng.XianShi(studentArray);
XveSheng.PanDuan(studentArray);
}
}
class Program
{
static void Main(string[] args)
{
XveSheng stud1 = new XveSheng(1,1002112,"", "男", 22, "信息与计算科学");
XveSheng stud2 = new XveSheng(2, 1002103, "", "男", 21, "信息与计算科学");
XveSheng stud3 = new XveSheng(3, 1002104,"", "男", 21, "信息与计算科学");
XveSheng stud4 = new XveSheng(4, 1002122, "", "女", 21, "应用数学");
XveSheng stud5 = new XveSheng(5, 1001121, "", "女", 20, "应用物理");
XveSheng stud6 = new XveSheng(0, 0, "", "", 0, "");
XveSheng stud7 = new XveSheng(0, 0, "", "", 0, "");
XveSheng stud8 = new XveSheng(0, 0, "", "", 0, "");
XveSheng stud9 = new XveSheng(0, 0, "", "", 0, "");
XveSheng stud10 = new XveSheng(0, 0, "", "", 0, "");
XveSheng[] Student = new XveSheng[]{stud1,stud2,stud3,stud4,stud5,stud6,stud7,stud8,stud9,stud10};
XveSheng.XianShi(Student);
XveSheng.PanDuan(Student);
Console.ReadLine();
}
}
}
有类似之处,能看懂就好,初学者或许有帮助的。

111,098

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧