當前位置:首頁 » 招生排名 » 吉林大學朝陽校區面向對象程序設計

吉林大學朝陽校區面向對象程序設計

發布時間: 2021-11-05 02:26:35

❶ 面向對象程序設計!!

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結束循環

所以答案應該為+**
(如果對你有用請給我個贊₍ᐢ •⌄• ᐢ₎)

❽ 求問一道大一面向對象程序設計題

大一面向對象程序設計題,這個可以看一下課本進行設計就行了。

熱點內容
四川農業大學申請考核博士 發布:2025-10-20 08:58:11 瀏覽:981
福田雷沃重工本科生待遇怎麼樣 發布:2025-10-20 08:53:49 瀏覽:575
華為要本科生嗎 發布:2025-10-20 08:25:41 瀏覽:550
2008年青島本科生工資 發布:2025-10-20 08:04:24 瀏覽:444
東北大學藝術考研 發布:2025-10-20 07:38:35 瀏覽:299
我的大學生活txt 發布:2025-10-20 07:35:28 瀏覽:25
人民大學外語系考研 發布:2025-10-20 07:31:12 瀏覽:894
上海交通大學考研輔導班 發布:2025-10-20 07:24:54 瀏覽:420
華中農業大學細胞生物學考研群 發布:2025-10-20 07:09:36 瀏覽:558
南京大學2016考研線 發布:2025-10-20 06:43:12 瀏覽:930