吉林大学朝阳校区面向对象程序设计
❶ 面向对象程序设计!!
class people {
protected double height, weight;
public void setp (double height, double weight) {
this.height = height;
this.weight = weight;
}
public void showp () {
System.out.println("height: " + height);
System.out.println("weight: " + weight);
}
}
public class student extends people {
private int sno;
public sets (double height, double weight, int sno) {
this.height = height;
this.weight = weight;
this.sno = sno;
}
public void shows () {
super.showp();
System.out.println("sno: " + sno);
}
public static void main (String args[]) {
student stu = new student();
stu.sets(1.80, 120.5, 12345);
stu.shows();
}
}
❷ 面向对象程序设计求答案
考试?接下来还有考试吗?可以在线写答案
❸ 吉林大学面向对象程序设计教材
准确的说,我们没有确切的教材,我们发的书是谭浩强的《C++程序设计》价格36元,一般书店都有,而且一般八折。但是我们上课却不是按照教材讲的。老师用自己设计的课件。我正在学这门课。信息绝对准确!!
❹ 面向对象程序设计
那很难受,天天加班,没时间陪你
❺ 《面向对象程序设计》课程设计
学生信息管理系统,给你一部分程序,符合要求把你邮箱发给我。#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;
❻ 面向对象程序设计试题82
void findminmax(int array[],int size,int &min,int &max){
min=array[0];
max=array[0];
int i=1;
while(i<size){
if(array[i]<min){min=array[i];}
if(array[i]>max){max=array[i];}
}
}
❼ 面向对象程序设计
i=1,j=2,输出+
i=2,j=4,输出*
i=3,j=8,输出*
此时j=8>5结束循环
所以答案应该为+**
(如果对你有用请给我个赞₍ᐢ •⌄• ᐢ₎)
❽ 求问一道大一面向对象程序设计题
大一面向对象程序设计题,这个可以看一下课本进行设计就行了。
