c++程序 学生信息管理系统 求代码 在线等 挺急的 20
结合已经学习的C/C++语言有关结构类型、指针、链表、(面向对象)等知识,编程实现一个简单学生课程成绩管理系统的部分功能,假设有两个表格:学生基本表(学号,姓名,性别,专...
结合已经学习的C/C++语言有关结构类型、指针、链表、(面向对象)等知识,编程实现一个简单学生课程成绩管理系统的部分功能,假设有两个表格:学生基本表(学号,姓名,性别,专业,所在系,平均绩点),学生成绩表(学号,课程号,课程名称,学分,课程成绩),其中,学号编码唯一,用字符串,如“20120001”,课号与课程名称存在一一对应关系,用字符串,学分用1~5整数,课程成绩用百分制,平均绩点为该学生已修课程成绩加权的平均学分值, 学生记录要求20人以上,课程数目要求4门以上,数据自拟。要求编程实现以下功能(基本 +扩展):
(1) 初次运行按输入数据分别建立学生基本表和学生成绩表,并将数据保存在两个文本文件(.txt)中,以后运行分别自动调用文本文件恢复数据。(基本)
(2) 分别增加两个表的数据记录,其中增加学生成绩表记录时要检查学号的合法性(是否在学生基本表中存在)。(基本)
(3) 对两个表按学号递增的次序重新排列。(基本)
(4) 对两个表实现按学号删除学生记录,其中删除学生基本表记录时,同时要删除成绩表中相同学号的学生记录。(基本)
(5) 按学号查询学生姓名、所在系、平均绩点和已修总学分。 (扩展)
(6) 对某门课程按课程成绩排序,并对平均绩点排序,要求输出学号、姓名、该课程排序号、平均绩点排序号。(扩展)
(7) 查询某专业学生的学生成绩情况,并按每个学生的平均绩点排序,计算该专业学生的平均绩点。 (扩展)
(8) 查询某门课程成绩不及格的情况,包括学号、姓名、课程号、课程名称和课程成绩。(扩展)
(9) 查询某门课程成绩平均成绩、最高成绩、最低成绩、成绩分布标准差、不同分数段的人数分布情况。(扩展)
(10) 查询某课程的学生相关信息,包括学号、姓名、专业、课程号、课程名称和课程成绩。(扩展)
(11) 按性别或专业统计计算某门课程的平均成绩。(扩展)
(12) 检查每个学生平均绩点计算是否正确和完整,并输出平均绩点排名前10%的所有学生信息。(扩展)
编程实现以上4项基本功能、并选扩展功能2项以上。 展开
(1) 初次运行按输入数据分别建立学生基本表和学生成绩表,并将数据保存在两个文本文件(.txt)中,以后运行分别自动调用文本文件恢复数据。(基本)
(2) 分别增加两个表的数据记录,其中增加学生成绩表记录时要检查学号的合法性(是否在学生基本表中存在)。(基本)
(3) 对两个表按学号递增的次序重新排列。(基本)
(4) 对两个表实现按学号删除学生记录,其中删除学生基本表记录时,同时要删除成绩表中相同学号的学生记录。(基本)
(5) 按学号查询学生姓名、所在系、平均绩点和已修总学分。 (扩展)
(6) 对某门课程按课程成绩排序,并对平均绩点排序,要求输出学号、姓名、该课程排序号、平均绩点排序号。(扩展)
(7) 查询某专业学生的学生成绩情况,并按每个学生的平均绩点排序,计算该专业学生的平均绩点。 (扩展)
(8) 查询某门课程成绩不及格的情况,包括学号、姓名、课程号、课程名称和课程成绩。(扩展)
(9) 查询某门课程成绩平均成绩、最高成绩、最低成绩、成绩分布标准差、不同分数段的人数分布情况。(扩展)
(10) 查询某课程的学生相关信息,包括学号、姓名、专业、课程号、课程名称和课程成绩。(扩展)
(11) 按性别或专业统计计算某门课程的平均成绩。(扩展)
(12) 检查每个学生平均绩点计算是否正确和完整,并输出平均绩点排名前10%的所有学生信息。(扩展)
编程实现以上4项基本功能、并选扩展功能2项以上。 展开
1个回答
展开全部
If you are willing to increase your rewarding to 500, I can help you program a code to meet your request.
20 is way too small for 200+ line code.
Here is the sample code I wrote before.
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
class Person {
protected:
string _name;
string _ID;
char _gender;
int _age;
public:
Person ( string n = "unknown", string id = "000-0000-000", char gen = 'N', int a = 0 )
: _name(n), _ID(id), _gender(gen), _age(a) {}
friend ostream& operator<< ( ostream& out, const Person& print ) {
out << "|" ;
out << setw(7+4) << print._name << "|";
out << setw(12+4) << print._ID << "|";
out << setw(1+4) << print._gender << "|";
out << setw(3+4) << print._age << "|";
return out;
}
};
class Job : public virtual Person {
protected:
string _ID4Job;
string _department;
string _company;
public:
Job ( string n = "unknown", string id = "000-0000-000", char gen = 'N', int a = 0,
string idj = "unknown", string dpt = "unknown", string comp = "unknown" )
: Person( n, id, gen, a ), _ID4Job( idj ), _department( dpt ), _company( comp ) {}
friend ostream& operator<< ( ostream& out, const Job& print ) {
out << "|" ;
out << setw(7+4) << print._name << "|";
out << setw(12+4) << print._ID << "|";
out << setw(1+4) << print._gender << "|";
out << setw(3+4) << print._age << "|";
out << setw(5+4) << print._ID4Job << "|";
out << setw(16+4) << print._department << "|";
out << setw(16+4) << print._company << "|";
return out;
}
};
class Student : public virtual Person {
protected:
string _ID4Study;
string _class;
string _major;
string _school;
public:
Student ( string n = "unknown", string id = "000-0000-000", char gen = 'N', int a = 0,
string ids = "unknown", string cl = "unknown", string mj = "unknown", string sh = "unknown" )
: Person ( n, id, gen, a ), _ID4Study( ids ), _class( cl ), _major( mj ), _school( sh ) {}
friend ostream& operator<< ( ostream& out, const Student& print ) {
out << "|" ;
out << setw(7+4) << print._name << "|";
out << setw(12+4) << print._ID << "|";
out << setw(1+4) << print._gender << "|";
out << setw(3+4) << print._age << "|";
out << setw(5+4) << print._ID4Study << "|";
out << setw(8+4) << print._class << "|";
out << setw(16+4) << print._major << "|";
out << setw(16+4) << print._school << "|";
return out;
}
};
class PartTime : public Job, public Student, public virtual Person {
private:
static int _number;
public:
PartTime ( string n = "unknown", string id = "000-0000-000", char gen = 'N', int a = 0,
string idj = "unknown", string dpt = "unknown", string comp = "unknown",
string ids = "unknown", string cl = "unknown", string mj = "unknown", string sh = "unknown" )
: Person( n, id, gen, a ), Job ( n, id, gen, a, idj, dpt, comp ), Student ( n, id, gen, a, ids, cl, mj, sh ) { ++_number; }
void display_PartTime_number () const { cout << "Part-time Student:\t" << _number << '\n'; }
friend ostream& operator<< ( ostream& out, const PartTime& print ) {
out << "|" ;
out << setw(7+4) << print._name << "|";
out << setw(12+4) << print._ID << "|";
out << setw(1+4) << print._gender << "|";
out << setw(3+4) << print._age << "|";
out << setw(5+4) << print._ID4Job << "|";
out << setw(16+4) << print._department << "|";
out << setw(16+4) << print._company << "|";
out << setw(5+4) << print._ID4Study << "|";
out << setw(8+4) << print._class << "|";
out << setw(16+4) << print._major << "|";
out << setw(16+4) << print._school << "|";
return out;
}
};
int PartTime::_number = 0;
int main(int argc, char *argv[]) {
// Demonstration:
Person one ( "Yeeson Yu", "123-3456-989", 'M', 26 );
cout << one << endl;
Job one_j ( "Yeeson Yu", "123-3456-989", 'M', 26,
"Engineer", "Innovation Center", "Smart Company" );
cout << one_j << endl;
Student one_s ( "Yeeson Yu", "123-3456-989", 'M', 26,
"CH234", "Mech-2", "structure design", "Engineering School" );
cout << one_s << endl;
PartTime one_p ( "Yeeson Yu", "123-3456-989", 'M', 26,
"Engineer", "Innovation Center", "Smart Company",
"CH234", "Mech-2", "structure design", "Engineering School" );
cout << one_p << endl;
cout << "\n\n === Part-time Student Information Table ===\n";
// Sample illustration
PartTime class_1[10];
for ( int i=0; i<10; i++ ) {
// **YOU MIGHT CONSIDER TO INSERT THE DETIAL OF EACH OBJECT**
// cin >> ......
cout << "[" << setw(3) << left << i+1 << "] " << class_1[i] << endl;
}
one_p.display_PartTime_number(); // 10 + 1 ( which is one_p) = 11
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询