当前位置:首页 » 课程大全 » c课程设计大纲

c课程设计大纲

发布时间: 2021-02-18 09:25:12

A. C语言课程设计大纲

有些复杂

B. C 课程设计

#include<iostream>

#include<iomanip.h>

#include<math.h>

usingnamespacestd;

intmain()

{

doublesample[6]={6.22,5.46,4.70,3.85,2.48,0.70},ym[6],r[6];

doubleb0,b1,b2,b3;

intflag,i;

b0=sample[0];

for(b2=-10;b2<10;b2+=0.01)

for(b3=-10;b3<10;b3+=0.01)

{

flag=1;

b1=sample[1]-b0-b2-b3;

for(i=2;i<6;i++)

if(fabs(b1-((sample[i]-b0)/i-b2*i-b3*i*i))>0.025)

{flag=0;break;}

if(flag)

{

cout<<"b0=6.22,b1="<<b1<<",b2="<<b2<<",b3="<<b3<<endl;

cout<<"------------------------------ ";

cout<<"xyymr% ";

cout<<"------------------------------ ";

for(i=0;i<6;i++)

{

ym[i]=b0+b1*i+b2*i*i+b3*i*i*i;

r[i]=fabs(ym[i]-sample[i])/sample[i]*100;

cout<<setw(2)<<i<<setw(6)<<sample[i];

cout<<setw(7)<<ym[i]<<setw(7)<<setprecision(2)<<r[i]<<endl;

}

cout<<"------------------------------ ";

return0;

}

}

return0;

}

C. c课程设计

#include<iostream>
#include<string.h>
#include<fstream>
using namespace std;
class controlloer //图书管理员
{
private:
int number;
int age;
char name[20];
public:
controlloer();
controlloer(int c,int a,char b[20] );
int getnumber();
int getage();
char *getname();
void reworkage(int i);
void reworkname(char a[20]);
};
controlloer::controlloer()
{
number=0;
char b[20]="no one";
age=0;
strcpy(name,b);
}
controlloer::controlloer(int c,int a,char b[20])
{
number=c;
age=a;
strcpy(name,b);
}
int controlloer::getage()
{return age;}
char *controlloer::getname()
{return name;}
int controlloer::getnumber()
{return number;}
void controlloer::reworkage(int i)
{age=i;}
void controlloer::reworkname(char a[20])
{strcpy(name,a);}
class reader //读者(学生,老师)
{
private:
int number;
int age;
char name[20];
char ye[20];
char borrowbook[20];

public:
reader();
reader(int c,int a,char b[20],char d[20],char e[20]);
int getnumber();
int getage();
char *getye();
char *getname();
char * getborrowbook();
void reworkborrowbook(char a[20]);
};
reader::reader()
{
char a[20]="没有人";
char b[20]="无职称";
char c[20]="没有借书";
number=0;
age=0;
strcpy(name,a);
strcpy(ye,b);
strcpy(borrowbook,c);
}
reader::reader(int a,int c,char b[20],char d[20],char e[20])
{
number=a;
age=c;
strcpy(name,b);
strcpy(ye,d);
strcpy(borrowbook,e);
}
int reader::getnumber(){return number;}
int reader::getage(){return age;}
char *reader::getye(){return ye;}
char *reader::getname(){return name;}
char * reader::getborrowbook(){return borrowbook;}
void reader::reworkborrowbook(char a[20]){strcpy(borrowbook,a);}
struct book //图书
{
int num;
char name[20];
char people[20];
};
void store() //存入图书信息
{
int i,c,b;
char a[20],d[20];
ifstream file("num.txt");
file>>b;
file.close();
cout<<"现有的图书个数:";
cout<<b<<endl;
cout<<"请输入你要输入的图书信息个数:"<<endl;
cin>>c;
book *shu=new book[c];
cout<<"输入图书信息(编号,名字,作者名:)"<<endl;
for(i=0;i<c;i++)
{
cin>>shu[i].num;
cin>>a>>d;
strcpy(shu[i].name,a);
strcpy(shu[i].people,d);
b++;
}
ofstream outfile("stu.txt",ios_base::app);
for(i=0;i<c;i++)
{
outfile.write((char *)&shu[i],sizeof(shu[i]));
}
outfile.close();
cout<<"存入成功!"<<endl;
ofstream tfile("num.txt");
tfile<<b;
tfile.close();
}
void outbook() //输出图书信息
{
int i,h,j,g,z;
char k ;
ifstream tfile("num.txt");
if(!tfile)
{
cout<<" 文件不存在! ";
tfile.close();
cout<<"你是否想创建(输入Y或N)";
cin>>k;
if(k=='N') exit(0);
else {ofstream tfile("num.txt");g=0;tfile<<g;}
}
else tfile>>g;
cout<<"本图书馆已经有"<<g<<"本图书"<<endl;
if(g==0)
{cout<<"图书馆里没有书!"<<endl;exit(0);}
else
{ book *shu=new book[g];
ifstream is("stu.txt",ios_base::binary);
if(is)
{

for(i=0;i<g;i++)
{
is.read((char *)&shu[i],sizeof(shu[i]));
}
for(i=0;i<g;i++)
{
cout<<"编号 名字 作者名"<<endl;
cout<<shu[i].num<<" "<<shu[i].name<<" "<<shu[i].people<<endl;
}
}
else
{
cout<<"ERROR:cannot open file'stu.txt'"<<endl;
}
is.close();
ifstream file("readernum.txt");
if(file) { file>>z; file.close();}
else { cout<<"没有文件";}
cout<<"已有的读者个数:";
cout<<z<<endl;
cout<<"输入你的编号:";
cin>>j;
cout<<"你想借哪本书(输入编号):";
cin>>h;
reader *people=new reader[z];
ifstream out("reader.txt",ios_base::binary);
if(out)
{

for(i=0;i<z;i++)
{
out.read((char *)&people[i],sizeof(people[i]));
}
}
else
{
cout<<"ERROR:cannot open file'stu.txt'"<<endl;
}
out.close();
people[j-1].reworkborrowbook(shu[h-1].name);
cout<<"编号 年龄 名字 职业 借书情况 "<<endl;
cout<<people[j-1].getnumber()<<" "<<people[j-1].getage()<<" "<<people[j-1].getname()<<" "<<people[j-1].getye()<<" "<<people[j-1].getborrowbook()<<endl;
ofstream outfile("reader.txt",ios_base::binary);
for(i=0;i<z;i++)
{
outfile.write((char *)&people[i],sizeof(people[i]));}
outfile.close();
}
cout<<"借阅成功!";
}
void controller() //图书管理员信息
{
int b,i,d,h=0;
ifstream file("controlloernum.txt");
if(file) { file>>b; file.close();cout<<"图书管理员个数:"<<b<<endl;}
else
{
cout<<"没有图书管信息理员"<<endl;
cout<<"你是否想创建(请输入Y或N):";
cin>>d;
if(d='y') {ofstream infile("controlloernum.txt");infile<<h;exit(0);}
else exit(0);
}
ifstream is("controlloer.txt",ios_base::binary);
if(is)
{
controlloer *bookpeople=new controlloer[b];
for(i=0;i<b;i++)
{
is.read((char *)&bookpeople[i],sizeof(bookpeople[i]));
}
for(i=0;i<b;i++)
{
cout<<"编号 年龄 名字 "<<endl;
cout<<bookpeople[i].getnumber()<<" "<<bookpeople[i].getage()<<" "<<bookpeople[i].getname()<<endl;
}
}

else
{
cout<<"ERROR:cannot open file'stu.txt'"<<endl;
cout<<"没有这个文件夹"<<endl;
cout<<"你是否想创建(请输入Y或N):";
cin>>d;
if(d='y') {ofstream infile("controlloer.txt");exit(0);}
else exit(0);

}
is.close();
}
void libary() //图书馆的总信息
{
system("cls");
system("color 2e");
cout<<" "<<endl;
cout<<" "<<endl;
cout<<" "<<endl;
cout<<"学校图书馆由本部图书馆及彭州校区图书馆组成.馆舍面积41048平方米";
cout<<" (其中现有馆舍面积11578 平方米,在建图书馆馆舍面积29470平方米),";
cout<<"各院系资料室面积1120平方米。学校拥有纸质文献198万余册, ";
cout<<"生均81.17册,电子文献161.7万余种。近三年校图书馆每年进书量均超过15万册."<<endl;
}
void storecontroller() //存入新的管理员的信息
{
int i,b,c,h=0;
char a[20],d;
ifstream file("controlloernum.txt");
if(file)
{
file>>b; file.close();cout<<"已有的图书管理员个数:";
cout<<b<<endl;
}
else
{
cout<<"没有图书管信息理员"<<endl;
cout<<"你是否想创建(请输入y或n):";
cin>>d;
if(d=='y')
{ofstream infile("controlloernum.txt");infile<<h;infile.close();b=0;}
else exit(0) ;
}
ofstream outfile("controlloer.txt",ios::app);
cout<<"请输入图书管理员的编号和年龄,名字:";
cin>>c>>i>>a;
controlloer bookpeople(c,i,a);
cout<<"编号 年龄 名字 "<<endl;
cout<<bookpeople.getnumber()<<" "<<bookpeople.getage()<<" "<<bookpeople.getname()<<endl;
outfile.write((char *)&bookpeople,sizeof(bookpeople));
outfile.close();
b++;
ofstream tfile("controlloernum.txt");
tfile<<b;
tfile.close();
cout<<"保存成功!";
}
void reworkcontrolloer() ///修改图书管理员
{
int i,b,h,j,g;
char d[20];
ifstream file("controlloernum.txt");
if(file) { file>>b; file.close();}
else {cout<<"没有图书管信息理员"; exit(0);}
cout<<"已有的图书管理员个数:";
cout<<b<<endl;
controlloer *bookpeople=new controlloer[b];
ifstream is("controlloer.txt",ios_base::binary);
if(is)
{
for(i=0;i<b;i++)
{
is.read((char *)&bookpeople[i],sizeof(bookpeople[i]));
}
for(i=0;i<b;i++)
{
cout<<"编号 年龄 名字 "<<endl;
cout<<bookpeople[i].getnumber()<<" "<<bookpeople[i].getage()<<" "<<bookpeople[i].getname()<<endl;
}
}
else
{
cout<<"ERROR:cannot open file'stu.txt'"<<endl;
}
is.close();
cout<<"请输入你要修改的管理员编号:";
cin>>h;
cout<<"输入年龄,名字:";
cin>>g>>d;
bookpeople[h-1].reworkage(g);
bookpeople[h-1].reworkname(d);
cout<<"该了后的名字:"<<bookpeople[h-1].getname();
ofstream tfile("controlloer.txt",ios_base::binary);
for(j=0;j<b;j++)
{
tfile.write((char *)&bookpeople[j],sizeof(bookpeople[j]));
}
tfile.close();
}

D. c 语言 课程设计

课程计划是根据一定的教育目的和培养目标,由教育行政部门制定的有关学校教专育和教学工作的指导性文件。属课程计划主要由课程计划的指导思想,培养目标课程设置和。那说明那个,课程安排,课程开设,顺序和时间内。荣升,课程计划主要是指,科学。教学目,科目的设置。课时分配与学年制。我和学周安排。

E. 《C语言程序设计》课程设计

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<conio.h>

#define BUFFERSIZE 1024
#define MAXACCOUNT 1000
typedef struct BankAccount
{
int account;
int key;
char name[32];
float balance;
}BANKACCOUNT;

BANKACCOUNT accountCollection[MAXACCOUNT];
int curAccount = 0;

void InsertAccount(FILE *fp)
{
BANKACCOUNT newaccount;
printf("please input the account information\n");
printf(">>account num:");
scanf("%d",&(newaccount.account));
printf(">>key:");
scanf("%d",&(newaccount.key));
printf(">>name:");
scanf("%s",newaccount.name);
printf(">>balance:");
scanf("%f",&(newaccount.balance));
fseek(fp,0L,SEEK_END);
fprintf(fp,"%d %d %s %.2f\n",newaccount.account,newaccount.key,newaccount.name,newaccount.balance);
}
void GetAccount(FILE *fp)
{
int accountnum;
int key;
char name[32];
float balance;
int i =0,j;
char buffer[BUFFERSIZE];
int len;
curAccount = 0;
fseek(fp,0,SEEK_SET);
while(!feof(fp)) /* 因为feof()最后会读2遍,所以最后curAccount多加了1 */
{
fscanf(fp,"%d %d %s %f",&accountnum,&key,name,&balance);
accountCollection[curAccount].account = accountnum;
accountCollection[curAccount].key = key;
strcpy(accountCollection[curAccount].name ,name);
accountCollection[curAccount].balance = balance;
curAccount++;
}
}
void ListAccount(FILE *fp)
{
int i =0;
printf("There is %d accounts at all:\n",curAccount-1);/* curAccount减去多加的1 */
for(i = 0;i< curAccount-1;i++)
{
printf("ACCOUNT[%d]:\n",i+1);
printf("account:%d\n",accountCollection[i].account);
printf("name:%s\n",accountCollection[i].name);
printf("balance:%.2f\n",accountCollection[i].balance);
}
}
int SearchAccount(FILE *fp,int accountnum)
{
int i =0;
for(i = 0;i< curAccount-1;i++)
{
if(accountCollection[i].account == accountnum)
{
printf("ACCOUNT[%d]:\n",i+1);
printf("account:%d\n",accountCollection[i].account);
printf("name:%s\n",accountCollection[i].name);
printf("balance:%.2f\n",accountCollection[i].balance);
return 1;
}
}
return 0;
}
void DelAccount(FILE *fp,int accountnum)
{
int i;
if(SearchAccount(fp,accountnum)==0)
printf("Can't find the account\n");
else
{
for(i = 0;i<curAccount-1;i++)
{
if(accountCollection[i].account != accountnum)
fprintf(fp,"%d %d %s %.2f\n",accountCollection[i].account,accountCollection[i].key,accountCollection[i].name,accountCollection[i].balance);
}
printf("delete successfully!\n");
}
}

int main()
{
FILE *fp;
int accountnum;
int i;
do{
system("cls"); //清屏
puts("********************************************");
puts("* You can choose : *");
puts("* 1 : Insert a new Account *");
puts("* 2 : List all Accounts *");
puts("* 3 : Find a Account *");
puts("* 4 : Delete a Account *");
puts("* 5 : quit *");
puts("********************************************");
printf("Please input your choice:");
scanf("%d",&i);
system("cls"); //清屏
switch(i)
{
case 1:
if(!(fp = fopen("account.txt","a+")))
{
printf("can't open the file account.txt\n");
exit(0);
}
InsertAccount( fp);

printf("press any key to continue.....\n");
getch();
fclose(fp);
break;
case 2:
if(!(fp = fopen("account.txt","r")))
{
printf("can't open the file account.txt\n");
exit(0);
}
GetAccount(fp);
ListAccount(fp);

fclose(fp);
printf("press any key to continue.....\n");
getch();
break;
case 3:
printf("please input the account num:\n");
scanf("%d",&accountnum);
if(!(fp = fopen("account.txt","r")))
{
printf("can't open the file account.txt\n");
exit(0);
}
GetAccount(fp);
if(!SearchAccount(fp,accountnum))
printf("There is not the account:%d\n",accountnum);

fclose(fp);
printf("press any key to continue.....\n");
getch();
break;
case 4:
printf("please input the account num:\n");
scanf("%d",&accountnum);
if(!(fp = fopen("account.txt","r")))
{
printf("can't open the file account.txt\n");
exit(0);
}
GetAccount(fp);
fclose(fp);
if(!(fp = fopen("account.txt","w+")))
{
printf("can't open the file account.txt\n");
exit(0);
}
DelAccount(fp,accountnum);
fclose(fp);
printf("press any key to continue.....\n");
getch();
break;
default:
break;
}
}while(i != 5);
return 0;
}
账户数据文件名已经设定为account.txt,这个文件要和上面这个程序放在同一个文件夹下面,不然就得用绝对路径(比如"d:\\book\\account.txt"),account内容可以用记事本打开自己改动,然后运行程序后就可以在程序中添加或删除

F. C语言课程设计案例精编的目录

基础知识篇
第1章C语言回顾
1.1C语言的出现及发展
1.2C语言的特点
1.3TurboC集成环境介绍
1.4Win-TC集成环境介绍
1.4.1Win-TC的特点
1.4.2Win-TC的使用
1.4.3Win-TC面板设置
1.5C语言基本语法概述
1.5.1数据类型、运算符和表达式
1.5.2程序设计结构
1.5.3数组
1.5.4函数
1.5.5编译预处理
1.5.6指针
1.5.7结构体
1.6小结
第2章基础知识回顾
2.1图形知识
2.1.1图形模式的初始化
2.1.2屏幕颜色相关函数
2.1.3图形窗口和图形屏幕函数
2.1.4画图函数
2.1.5封闭图形的填充
2.1.6图形模式下的文本输出
2.2文件操作知识
2.2.1文件的打开与关闭
2.2.2文件的读写
2.2.3文件的状态
2.2.4文件的定位
2.3Windows网络编程知识
2.3.1常用协议报头
2.3.2Winsock基础
2.3.3套接字选项
2.3.4名字解析
2.4中断知识
2.4.1中断类型与中断函数
2.4.2鼠标编程
2.5小结
游戏开发篇
第3章俄罗斯方块游戏
3.1设计目的
3.2功能描述
3.3总体设计
3.3.1功能模块设计
3.3.2数据结构设计
3.3.3函数功能描述
3.4程序实现
3.4.1源码分析
3.4.2运行结果
3.5小结
第4章推箱子游戏
第5章五子棋游戏
第6章学生成绩管理系统
第7章工资管理系统
第8章电话簿管理系统
第9章Ping程序设计
第10章TCP程序设计
第11章UDP程序设计
仿Windows应用程序篇
第12章万年历
第13章画图板
第14章电子时钟
第15章简易计算器
第16章文本编辑器
附录
附录AASCII表
附录BC语言编程易犯错误分析

G. 什么叫“课程设计大纲”

课程设计分为实际课程与虚拟课程,所谓实际课程就是实际操作的计划安排,回例如,安排好答今天要学习的课本章节,上午要学习哪些内容,下午要学习哪些内容;虚拟课程就是把将要做的任务安排记在头脑里,不一定要立即实行。
课程标准是规定某一学科的课程性质、课程目标、内容目标、实施建议的教学指导性文件。课程标准与教学大纲相比,在课程的基本理念、课程目标、课程实施建议等几部分阐述的详细、明确,特别是提出了面向全体学生的学习基本要求

H. C语言课程设计 设计思路

首先加载本地文件保存的信息,创建链表,并统计个数,然后根据选择的操作执行相应的方法

热点内容
武汉大学学生会辅导员寄语 发布:2021-03-16 21:44:16 浏览:612
七年级学生作文辅导学案 发布:2021-03-16 21:42:09 浏览:1
不屑弟高考成绩 发布:2021-03-16 21:40:59 浏览:754
大学毕业证会有成绩单 发布:2021-03-16 21:40:07 浏览:756
2017信阳学院辅导员招聘名单 发布:2021-03-16 21:40:02 浏览:800
查询重庆2018中考成绩查询 发布:2021-03-16 21:39:58 浏览:21
结业考试成绩怎么查询 发布:2021-03-16 21:28:40 浏览:679
14中医医师资格笔试考试成绩查分 发布:2021-03-16 21:28:39 浏览:655
名著赏析课程标准 发布:2021-03-16 21:27:57 浏览:881
北京大学商业领袖高端培训课程 发布:2021-03-16 21:27:41 浏览:919