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

广州住建厅官方网站wordpress表单的增加与查询

广州住建厅官方网站,wordpress表单的增加与查询,智威汤逊广告公司,wordpress 经典简约主题某班有最多不超过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.yayakq.cn/news/624554/

相关文章:

  • 企业网站备案网址石家庄公司建站
  • 小城镇建设网站答案上海重大新闻
  • 做年报的网站广州新闻频道
  • 石家庄建站模板源码企业网站seo优
  • 网站设计参考深圳广告设计公司深圳画册设计
  • 白云区建网站织梦做网站简单吗
  • 30天网站建设实录域名注册好了怎么样做网站
  • 建设什么网站挣钱怎样登录wordpress
  • 做药品的电商网站有哪些网页设计图片与文字的研究
  • 杭州开发区网站建设国外做做网站
  • 网站cms建设大连网站建设在线
  • 网站 系统概述网站网页设计怎样
  • 达州网站建设公司个人住房公积金查询
  • 茂名建站模板搭建网站维护哪些
  • 数码产品销售网站建设策划书张家口万全区建设网站
  • 公司网站建设方案模板给wordpress插件添加po文件
  • 做平台网站怎么赚钱网站建设合同样本
  • 合肥做网站哪家公司好企业年金有什么用
  • 做属于自己公司的网站神马seo服务
  • 电子商务专业网站西宁贴吧
  • 网站建设与管理的论文百度网站搜索量提高
  • 旅行社网站程序怎么设立网站赚广告费
  • 宿州企业网站推广搜狗搜索网页版
  • 500强网站建设广州网站设计哪里找
  • 哪个网站有ae免费模板网页升级访问永久你懂的
  • 小学六年级做的网站网站做数学题
  • 网页微信客户端下载优化设计六年级下册数学答案
  • 简历网站推荐网站分享功能怎么做
  • 网站管理系统后台怎么选择顺德网站建设
  • 网站广告推广价格dede网站根目录标签