导航:首页 > 编程语言 > vc面向对象程序设计

vc面向对象程序设计

发布时间:2023-05-20 16:45:41

⑴ C++面向对象程序设计试题

一、1.C 2.D 3.A 4.A 5.C 6.B 7.B 8.C 9.D 10.B 11.A 12.B 13.B 14.C 15.C
二、1.封装、继承、多态;2.传值、传址;3.Template;4.~student();5.私有;6.参数、返回值;7.优先级、结合性、运算顺序;8.代码的复用、MFC编程;9.X、Y;10.new

⑵ C++语言是一种面向对象的程序设计语言。这个面向对象指的是什么

面向对象是不同于面向过程的一种编程思想。它是将自己搞不定的事或做起来比较版费力的事委托给信权任的人来做(如VC++中的可视化组具体是怎么来的,我们不用担心,只要知道怎么用就行);面向过程是事无大小均由自己完成,从底层到顶层,从内部到外部。举例说明:面向对象像是皇帝,吃喝拉撒都由太监宫女搞定,治理国家由文武百官搞定,他只要会用人、决策、享受主行;而面向过程就像是百姓,吃,自己种地,喝,自己挖井,穿,自己织布等等

⑶ 《面向对象程序设计》课程设计

学生信息管理系统,给你一部分程序,符合要求把你邮箱发给我。#include<string.h>
#include<stdlib.h>
#include<ctype.h>
#include <math.h>
#include"form.h"
#include"add.h"extern int count;
////////////////////////////函数声明//////////////////////////
void sortdate(); //2.记录排序
void printreport(struct student *head); //3.打印学生成绩
void searchstudents(); //6.查询学生信息
void statscore(); //7.统计成绩
void out(); //0.退出
int total(struct student *nod); //计算总分
int zavg(struct student *nod); //计算平均分整数部分
int xavg(struct student *nod); //计算平均分小数部分
void SortAllData(struct student *head,int count, int (*p)());//排序
int CompareSnoAsc(struct student *p,struct student *q); //学号升序////////////////////////////函数实现//////////////////////////
void main()
{
winwelcome();
do{
system("cls");
winmenulist();
onlyoneinput(56,16); //输入单个选项
switch(key)
{
case '1': //1.添加学生信息
addstudentinfo();
break;
case '2': //2.记录排序
sortdate();
break;
case '3': //3.打印学生成绩
printreport(head);
break;
case '6': //6.查询学生信息
searchstudents();
break;
case '7': //7.统计成绩
statscore();
break;
case '0':
out();
continue;
case '\r':
continue;
case ' ':
continue;
default:
goxy(2,20);
putchar(key);
printf(" is a error number, please input a number between 0 to 7");
goxy(2,21);
printf("Press any key to continue");
getch();
}
}while(1);
}/////////////////////////2.记录排序//////////////////////////
void sortdate()
{
while (1)
{
system("cls");
winsortdate();
onlyoneinput(55,17);
switch(key)
{
case '1': //按学号升序排
system("cls");
winstudengrade();
goxy(31,3);
printf("Rise By Student Number");
// SortAllData(head,count,CompareSnoAsc);
goxy(1,21);
printf("Press any key to continue");
getch();
break;
case '2': //按学号降序排
winstudengrade();
goxy(33,3);
printf("Descend By Number");
goxy(1,21);
printf("Press Any Key To Continue");
break;
case '3': //按总分升序排
winstudengrade();
goxy(35,3);
printf("Rise By Total");
goxy(1,21);
printf("Press Any Key To Continue");
break;
case '4': //按总分降序排
winstudengrade();
goxy(34,3);
printf("Descend By Total");
goxy(1,21);
printf("Press Any Key To Continue");
break;
//case 5:
default:
goxy(2,20);
putchar(key);
printf(" is a error number, please input a number between 0 to 4");
goxy(2,21);
printf("press any key to continue");
getch();
}
}
}///////////////////////////3.打印学生成绩/////////////////////////
void printreport(struct student *head)
{
int i,j,page=1;
struct student *node;
node=head;
while(node)
{
system("cls");
winstudengrade();
goxy(31,3);
printf("Print Student's Report");
j=8;
for(i=1;i<=10;i++,j++)
{
goxy(1,j);
printf("%s",node->sno);
goxy(6,j);
printf("%s",node->name);
goxy(26,j);
printf("%s",node->age);
goxy(30,j);
printf("%3d",node->chinese);
goxy(38,j);
printf("%3d",node->english);
goxy(46,j);
printf("%3d",node->math);
goxy(51,j);
printf("%3d",node->physics);
goxy(59,j);
printf("%3d",node->chemistry);
goxy(69,j);
printf("%3d",total(node));
goxy(75,j);
printf("%2d.%d",zavg(node),xavg(node));
node=node->next;
if (node==NULL)
break;
}
goxy(2,20);
printf("Press up key to up page");
goxy(2,21);
printf("Press down key to next page");
goxy(2,22);
printf("Press esc key to exit");
while(1)
{
key=getch();
if (key==27)
return;
if (key<=0)
{
key=getch();
if (key==72&&page!=1) //向上翻页
{
node=node-10;
page--;
break;
}
if (key==80&&node!=NULL) //向下翻页
{
page++;
break;
}
}
}
}
}///////////////////////////6.查询学生信息//////////////////////////
void searchstudents()
{
scanf("%d",key);
system("cls");
switch(key)
{
case '1':
winstudengrade();
goxy(33,3);
printf("Search By Number");
goxy(1,21);
printf("Please Input Any Key TO Continue");
break;
case '2':
winstudengrade();
goxy(35,3);
printf("Search By Name");
goxy(1,21);
printf("Please Enter Any Key TO Continue");
// case 3:
//返回上级目录
}
}///////////////////////////7.统计成绩/////////////////////////
void statscore()
{
winstatscore();
}////////////////////////////0.退出//////////////////////////
void out()
{
while(1)
{
system("cls");
winout();
onlyoneinput(55,11);
if (key=='Y'||key=='y')
exit(0);
else if(key=='N'||key=='n')
break;
else
{
goxy(2,20);
putchar(key);
printf(" is a error option,please input a option ( Y or N )");
goxy(2,21);
printf("please input anykey to continue");
getch();
}
}
}/////////////////////计算总分/////////////////////
int total(struct student *nod)
{
int sum=0;
sum=nod->chinese+nod->english+nod->math+nod->physics+nod->chemistry;
return sum;
}//////////////////计算平均分////////////////////
int zavg(struct student *nod) //整数部分
{
int i=0;
i=total(nod)/5;
return i;
}
int xavg(struct student *nod) //小数部分
{
float i;
int j;
i=total(nod)/5.0;
j=(i-zavg(nod))*10;
return j;
}///////////////////////排序////////////////////////
void SortAllData(struct student *head,int count, int (*p)())
{
struct student *i,*j,*temp=NULL;
i=j=head;
for (i=head;i!=NULL;i=i->next)
{
for (j=i->next;j!=NULL;j=j->next)
{
if ((*p)())
{
temp->pre=i->pre;
temp->next=i->next;
i->pre->next=temp;
i->next->pre=temp;
i->pre=j->pre;
i->next=j->next;
j->pre->next=i;
j->next->pre=i;
j->pre=temp->pre;
j->next=temp->next;
temp->pre->next=j;
temp->next->pre=j;
}
}
}
printreport(head);
}///////////////////////学号升降序/////////////////////int CompareSnoAsc(struct student *p,struct student *q) //学号升序
//{
// return strcmp(p->sno,q->sno)>0;
//}
//int CompareSnoDesc(struct student *p,struct student *q)//学号降序
//{
// return strcmp(p->sno,q->sno)<0;

阅读全文

与vc面向对象程序设计相关的资料

热点内容
拷贝过来的pdf文件 浏览:751
抖音小店的访客数据怎么看 浏览:670
怎么把c语言编程的字符向下移动 浏览:786
sql删除文件组代码 浏览:978
安卓post请求多重json 浏览:776
微信消除数据怎么恢复 浏览:918
小米刷机显示系统找不到指定文件 浏览:528
苹果手机小风扇图app叫什么 浏览:292
繁体中文输入工具 浏览:916
pc桌面壁纸文件夹 浏览:473
微信怎么添加群 浏览:781
40岁男人适合的微信名 浏览:925
编程里比例怎么打 浏览:215
苹果12两个app如何分屏 浏览:592
ps下载完不是压缩文件 浏览:362
电脑中的个人文件包括什么 浏览:572
网络连接一般什么密码 浏览:199
java定时器quartz实例 浏览:259
稻壳excel文件太大怎么弄 浏览:901
文件里的视频如何保存到相册 浏览:428

友情链接