程序运行出错,请高手帮助

Jecst Jecst 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区

#include "iostream"
#include "windows.h"

using std::cout;
using std::endl;
using std::cin;

class Student
{
public:
Student(){}
Student(char s_chool,char c_lass,char n_name,int s_tudent_number,int c_hinese,int m_athematics,\
int e_nglish,int h_istory,int g_eography,int b_iological,int p_olitical,int p_hysical,\
int c_hemistry,int s_ports,int m_usic):
School(s_chool),
Class(c_lass),
Name(n_name),
Student_Number(s_tudent_number),
Chinese(c_hinese),
Mathematics(m_athematics),
English(e_nglish),
History(h_istory),
Geography(g_eography),
Biological(b_iological),
Political(p_olitical),
Physical(p_hysical),
Chemistry(c_hemistry),
Sports(s_ports),
Music(m_usic)
{}

~Student()
{
cout<<"Destructor Function"<<endl;
}

void SetSchool(char);
void SetClass(char);
void SetName(char);
void Set_Student_number(int);
void Set_Chinese(int);
void Set_Mathematics(int);
void Set_English(int);
void Set_History(int);
void Set_Geography(int);
void Set_Biological(int);
void Set_Political(int);
void Set_Physical(int);
void Set_Chemistry(int);
void Set_Sports(int);
void Set_Music(int);

char Get_School();
char Get_Class();
char Get_Name();
int Get_Student_number()const;
int Get_Chinese()const;
int Get_Mathematics()const;
int Get_English()const;
int Get_History()const;
int Get_Geography()const;
int Get_Biological()const;
int Get_Political()const;
int Get_Physical()const;
int Get_Chemistry()const;
int Get_Sports()const;
int Get_Music()const;

private:
char School;
char Class;
char Name;
int Student_Number;
int Chinese;
int Mathematics;
int English;
int History;
int Geography;
int Biological;
int Political;
int Physical;
int Chemistry;
int sports;
int Music;
};

void Student::SetSchool(char school)
{
School=school;
}

void Student::SetClass(char _class)
{
Class = _class;
}

void Student::SetName(char name)
{
Name = name;
}

void Student::Set_Student_number(int set_student_number)
{
Student_Number = set_student_number;
}

void Student::Set_Chinese(int set_chinese)
{
Chinese = set_chinese;
}

void Student::Set_Mathematics(int mathematics)
{
Mathematics = mathematics;
}

void Student::Set_English(int english)
{
English = english;
}

void Student::Set_History(int history)
{
History = history;
}

void Student::Set_Geography(int geography)
{
Geography = geography;
}

void Student::Set_Biological(int biological)
{
Biological = biological;
}

void Student::Set_Political(int political)
{
Political = political;
}

void Student::Set_Physical(int physical)
{
Physical = physical;
}

void Student::Set_Chemistry(int chemistry)
{
Chemistry = chemistry;
}

void Student::Set_Sports(int sports)
{
Sports = sports;
}

void Student::Set_Music(int music)
{
Music = music;
}


char Student::Get_School()
{
return School;
}

char Student::Get_Class()
{
return Class;
}

char Student::Get_Name()
{
return Name;
}

int Student::Get_Student_number()const
{
return Student_Number;
}

int Student::Get_Chinese()const
{
return Chinese;
}

int Student::Get_Mathematics()const
{
return Mathematics;
}

int Student::Get_English()const
{
return English;
}

int Student::Get_History()const
{
return English;
}

int Student::Get_Geography()const
{
return Geography;
}

int Student::Get_Biological()const
{
return Biological;
}

int Student::Get_Political()const
{
return Political;
}

int Student::Get_Physical()const
{
return Physical;
}

int Student::Get_Chemistry()const
{
return Chemistry;
}

int Student::Get_Sports()const
{
return Sports;
}

int Student::Get_Music()const
{
return Music;
}
int main()
{
int choice;

char s,c,n;

int __Student_Number;
int __Chinese;
int __Mathematics;
int __English;
int __History;
int __Geography;
int __Biological;
int __Political;
int __Physical;
int __Chemistry;
int __Sports;
int __Music;
int answer;
int average;
cout<<" ====================================================="<<endl;
cout<<" || 欢迎进入本系统,本软件仅供测试使用,非商业软件||"<<endl;
cout<<" ====================================================="<<endl;
cout<<"数据加载中..."<<endl;
for(int j=0;j<40;j++)
{
Sleep(100);
cout<<"■";

}

cout<<endl;
cout<<"数据加载完成"<<endl;
cout<<endl;
for(int i=0;i<1;i++)
{
cout<<"请输入学校名";
cin>>s;
cout<<endl;

cout<<"请输入你的班级";
cin>>c;
cout<<endl;

cout<<"请输入你的姓名";
cin>>n;
cout<<endl;

cout<<"请输入你的学号";
cin>>__Student_Number;
cout<<endl;

cout<<"请输入你的语文成绩 ";
cin>>__Chinese;
cout<<endl;

cout<<"请输入你的 数学成绩 ";
cin>>__Mathematics;
cout<<endl;

cout<<"请输入你的英文成绩 ";
cin>>__English;
cout<<endl;

cout<<"请输入你的历史成绩 ";
cin>>__History;
cout<<endl;

cout<<"请输入你的地理成绩 ";
cin>>__Geography;
cout<<endl;

cout<<"请输入你的生物成绩 ";
cin>>__Biological;
cout<<endl;

cout<<"请输入你的政治成绩 ";
cin>>__Political;
cout<<endl;

cout<<"请输入你的物理成绩 ";
cin>>__Physical;
cout<<endl;

cout<<"请输入你的化学成绩 ";
cin>>__Chemistry;
cout<<endl;

cout<<"请输入你的体育成绩 ";
cin>>__Sports;
cout<<endl;

cout<<"请输入你的美术成绩 ";
cin>>__Music;
cout<<endl;
}

Student object(' ',' ',' ', __Student_Number, __Chinese, __Mathematics, __English, __History, __Geography, __Biological, __Political, __Physical, __Chemistry, __Sports, __Music);

object.SetSchool(s);
object.SetClass(c);
object.SetName(n);

cout<<"请输入你要查看的成绩"<<endl;
cout<<"编号 :"<<endl;
cout<<"(1)语文 (2)数学 (3)英文 (4)历史 (5)地理 (6)生物 (7)政治 (8)物理 (9)化学 (10)体育 (11)美术 (12)打印所以分数之和";
cin>>choice;
switch(choice)
{
case 1:
cout<<"数据加载成功,你的语文成绩是:"<<object.Get_Chinese()<<endl;
break;
case 2:
cout<<"数据加载成功,你的数学成绩是:"<<object.Get_Mathematics()<<endl;
break;
case 3:
cout<<"数据加载成功,你的英语成绩是:"<<object.Get_English()<<endl;
break;
case 4:
cout<<"数据加载成功,你的历史成绩是:"<<object.Get_History()<<endl;
break;
case 5:
cout<<"数据加载成功,你的地理成绩是:"<<object.Get_Geography()<<endl;
break;
case 6:
cout<<"数据加载成功,你的生物成绩是:"<<object.Get_Biological()<<endl;
break;
case 7:
cout<<"数据加载成功,你的政治成绩是:"<<object.Get_Political()<<endl;
break;
case 8:
cout<<"数据加载成功,你的物理成绩是:"<<object.Get_Physical()<<endl;
break;
case 9:
cout<<"数据加载成功,你的化学成绩是:"<<object.Get_Chemistry()<<endl;
break;
case 10:
cout<<"数据加载成功,你的体育成绩是:"<<object.Get_Sports()<<endl;
break;
case 11:
cout<<"数据加载成功,你的音乐成绩是:"<<object.Get_Music()<<endl;
break;
case 12:
answer = object.Get_Chinese()+object.Get_Mathematics()+object.Get_English()+object.Get_History()+\
object.Get_Geography()+object.Get_Biological()+object.Get_Political()+object.Get_Physical()+\
object.Get_Chemistry()+object.Get_Sports()+object.Get_Music();
cout<<"你的总分是:"<<answer<<endl;
break;
case 13:
answer = object.Get_Chinese()+object.Get_Mathematics()+object.Get_English()+object.Get_History()+\
object.Get_Geography()+object.Get_Biological()+object.Get_Political()+object.Get_Physical()+\
object.Get_Chemistry()+object.Get_Sports()+object.Get_Music();
average =answer/11;
cout<<"你的总分是:"<<answer<<endl;
cout<<"你好,你查询的平均分是: "<<average<<endl;

}
return 0;
}
...全文

相关推荐

c++程序运行出错问题处理

可以解决c++某些程序运行出错的问题 可以解决c++某些程序运行出错的问题 可以解决c++某些程序运行出错的问题 可以解决c++某些程序运行出错的问题

wyadjsnye

mysql安装后.net程序运行出错的解决方法

发现问题 最近在安装mysql后运行.net程序出错: 出错位置:C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config 出错信息:未能加载文件或程序集“MySql.ConnectorInstaller, Version=6.10.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d”或它的某一个依赖项。系统找不到指定的文件。 图示: 原因: 当你安装MySQL .NET Connector 6.9.4(也可能是其他版本)时,会出现这个令人厌恶的错误,因为如果

weixin_38559569

关于pb调用C#的com出错问题的dll,请大家帮助一下

上次在论坛里面提出这个问题后一直没有解决,现在把我的dll发出来,请大家帮忙看看

zephyr_liyo

Facebook登录报错:将你登入到此应用程序时出错,请稍后再试。

这里帖几个有解决问题指导方向的连接: stackoverflow “Login Error: There is an error in logging you into this application. Please try again later” facebook login troubleshoot facebook 关于Login Error: There is an error in logging you into this application. Please try again later. 的讨论帖子 总结一下就是facebook sdk的bug,需要你更新一下hash

weixin_38630571

office2021安装出错解决方法.docx

office2021安装出错解决方法.docx

Lidx0710
评论 4
收藏 已收藏
分享
返回顶部
Jecst
C++ 语言 65,214 成员 250,514 内容