用c#算成绩的总和_【c#编写一个学生成绩计算程序,统计出一个班学生的某门课程各分数段的人数(分数段:90分以上,80-90,70-80,编写一个学生成绩计算程序,统计出一个班学生的某门课程各分数段的...

c#编写一个学生成绩计算程序,统计出一个班学生的某门课程各分数段的人数(分数段:90分以上,80-90,70-80,

编写一个学生成绩计算程序,统计出一个班学生的某门课程各分数段的人数(分数段:90分以上,80-90,70-80,60-70,60分以下)

成绩的计算方式是:平时成绩*40%+期末成绩*60%=最终成绩.

并显示出该班该门课的最高成绩和学生姓名,最低成绩和学生姓名

求教怎么修改

下面粘代码

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace xx

{

class Program

{

static void Main(string[] args)

{

int[] score = new int[10]; string[] m = { };

int i, a, b, c, d, e;

a = b = c = d = e = 0;

double[] math = new double[10];

double t = 0, max, min, r;

//int i;

Console.WriteLine("请输入20名学生的成绩 每名学生成绩输入后按回车输入下一位");

for (i = 0; i < 10; i++)

score[i] = Convert.ToInt32(Console.ReadLine());

for (i = 0; i < 10; i++)

{

switch (score[i] / 10)

{

case 10:

case 9: a++; break;

case 8: b++; break;

case 7: c++; break;

case 6: d++; break;

default: e++;

break;

}

}

for (i = 0; i < 10; i++)

math[i] = Convert.ToDouble(Console.ReadLine());

max = math[0];

min = math[0];

for (i = 0; i < 10; i++)

{

t += math[i];

if (math[i] > max) max = math[i];

if (math[i] < min) min = math[i];

}

r = t / 10;

Console.WriteLine("平均分为:{0}", r);

Console.WriteLine("最高分为:{0}", max);

Console.WriteLine("最低分为:{0}", min);

Console.WriteLine("得优人数 :{0}", a);

Console.WriteLine("得良人数 : {0}", b);

Console.WriteLine("得好人数 :{0}", c);

Console.WriteLine("及格人数 :{0}", d);

Console.WriteLine("不及格人数 :{0}", e);

Console.ReadLine();

}

}

}

作业帮用户2017-11-03举报

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值