当前位置: 首页 > news >正文

东莞网站建设优化企业营销顾问

东莞网站建设优化企业,营销顾问,洱源县建设局门户网站,西宁做网站多少钱某班有最多不超过30人(具体人数由键盘输入)参加某门课程的考试,用一维数组作函数参数编程实现如下学生成绩管理: (1)录入每个学生的学号和考试成绩; (2)计算课程的总分…

某班有最多不超过30人(具体人数由键盘输入)参加某门课程的考试,用一维数组作函数参数编程实现如下学生成绩管理:

1)录入每个学生的学号和考试成绩;

2)计算课程的总分和平均分;

3)按成绩由高到低排出名次表;

4)按学号由小到大排出成绩表;

5)按学号查询学生排名及其考试成绩;

6)按优秀(90~100)、良好(80~89)、中等(70~79)、及格(60~69)、不及格(0~595个类别,统计每个类别的人数以及所占的百分比;

7)输出每个学生的学号、考试成绩。

#include <iostream>
#include <iomanip>
using namespace std;
void input(int a[], float b[],int);
void caculate(float a[],int);
void sort_in_descending_order_by_score(int a[], float b[],int);
void sort_in_ascending_order_by_number(int a[],float b[],int);
void search(int a[],float b[],int);
void statistic(float a[],int);
int main()
{int n;cout << "Input student number(n<30):";cin >> n;int choice;int xvehao[30];float score[30];while (1){cout << endl;cout << "Management for Students' scores" << endl;cout << "1.Input record" << endl;cout << "2.Caculate total and average score of course" << endl;cout << "3.Sort in descending order by score" << endl;cout << "4.Sort in ascending order by number" << endl;cout << "5.Search by number" << endl;cout << "6.Statistic analysis" << endl;cout << "7.List record" << endl;cout << "0.Exit" << endl;cout << "Please Input your choice:";cin >> choice;if (choice == 1)input(xvehao, score, n);else if (choice == 2)caculate(score, n);else if (choice == 3)sort_in_descending_order_by_score(xvehao, score, n);else if (choice == 4)sort_in_ascending_order_by_number(xvehao, score, n);else if (choice == 5)search(xvehao, score, n);else if (choice == 6)statistic(score, n);else if (choice == 7)sort_in_ascending_order_by_number(xvehao, score, n);else if (choice == 0)break;else{cout << "Please input any number from 0 to 7!"<<endl; continue;}}return 0;
}
void input(int a[], float b[],int n)
{int i;cout << "Input student's ID, name and score:" << endl;for (i = 1; i <= n; i++){cin >> a[i] >> b[i];}}
void caculate(float a[], int n)
{float sum=0,aver;int i;for (i = 1; i <= n; i++){sum += a[i];}aver = sum / n;cout << "sum=" << sum << " , aver=" << fixed << setprecision(2) << aver;cout << endl;
}
void sort_in_descending_order_by_score(int a[], float b[], int n)
{int i, j,k;for (i = 1; i <= n; i++){k = i;for (j = i+1; j <= n ; j++){if (b[k] < b[j])k = j;}int x = a[i], y = b[i];a[i] = a[k]; b[i] = b[k];a[k] = x; b[k] = y;}for (i = 1; i <= n; i++){cout << a[i] << " " << b[i] << endl;}
}
void sort_in_ascending_order_by_number(int a[], float b[], int n)
{int i, j,k;for (i = 1; i <= n; i++){k = i;for (j = i + 1; j <= n; j++){if (a[j] < a[k])k = j;}int x = a[i], y = b[i];a[i] = a[k]; b[i] = b[k];a[k] = x; b[k] = y;}for (i = 1; i <= n; i++){cout << a[i] << " " << b[i] << endl;}
}
void search(int a[], float b[], int n)
{int number;cin >> number;int i,k;for (i = 1; i <= n; i++){if (a[i] == number){cout << a[i] << " " << b[i]<<endl;k = 1;break;}else k = 0;}if (k == 0)cout << "Can't find this student!"<<endl;
}
void statistic(float a[], int n)
{int i;int A = 0, B = 0, C = 0, D = 0, E = 0, F = 0;for (i = 1; i <= n; i++){if (a[i] == 100)A++;else if (a[i] >= 90 && a[i] <= 99)B++;else if (a[i] >= 80 && a[i] <= 89)C++;else if (a[i] >= 70 && a[i] <= 79)D++;else if (a[i] >= 60 && a[i] <= 69)E++;else F++;}cout << "<60 "  << F<< " " <<fixed<<setprecision(2)<< ((float)F / n) * 100 << "%" << endl;cout << "60-69 "  << E<< " " << fixed << setprecision(2) << ((float)E / n) * 100 << "%" << endl;cout << "70-79 "  << D<< " " << fixed << setprecision(2) << ((float)D / n) * 100 << "%" << endl;cout << "80-89 "  << C<< " " << fixed << setprecision(2) << ((float)C / n) *100<< "%"<<endl;cout << "90-99 "  << B<< " " << fixed << setprecision(2) << ((float)B / n) * 100 << "%" << endl;cout << "100 "  << A<< " " << fixed << setprecision(2) << ((float)A / n) * 100 << "%" << endl;
}

http://www.ds6.com.cn/news/19984.html

相关文章:

  • 网站的架设免费网页在线客服系统
  • 在哪里可以做公司网站营销推广seo
  • 网站视频放优酷里面怎么做搜索关键词软件
  • 重庆做网站建设网站宣传和推广的方法有哪些
  • 黑龙江省建设会计协会网站首页找培训机构的网站
  • 华大基因 网站建设公司刷关键词排名seo软件软件
  • 陕西做网站的公司地址上海网站建设推广服务
  • 网站代运营做哪些提高工作效率图片
  • 网站导航图怎么做的详细步骤百度网站优化软件
  • seo是做网站广西seo关键词怎么优化
  • 青海省建设局网站首页适合40岁女人的培训班
  • 东莞技术好的网站建设北京优化靠谱的公司
  • 做网站推广工作赚钱吗自助网站建设平台
  • 软件开发项目经理seo公司赚钱吗
  • 什么网站可以做h5互联网站
  • 南宁网站建设推广百度竞价点击价格公式
  • 日本做鸡做爱成人网站播放营销策划公司排行榜
  • 海盐网站建设谷歌广告怎么投放
  • 什么是网站的原型百度热搜榜排名今日第一
  • 做网站需要哪些技术外贸营销策略都有哪些
  • 石家庄网站如何制作免费开通网站
  • 网站备案域名购买网页设计制作网站素材
  • 北京做网站的公司拟推广普通话内容100字
  • 网站建设总结报告成都网站seo收费标准
  • 网站建设自评报告东莞网站建设优化技术
  • 个人网站有商业内容备案关键词优化计划
  • 深圳商城网站建设报价单如何设计网站步骤
  • 大余网站建设网络营销推广手段
  • 政府网站建设工作室长沙seo服务
  • 红阳建设集团网站seo是搜索引擎优化吗