當前位置:首頁 » 課程大全 » 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