九九热最新网址,777奇米四色米奇影院在线播放,国产精品18久久久久久久久久,中文有码视频,亚洲一区在线免费观看,国产91精品在线,婷婷丁香六月天

歡迎來到裝配圖網(wǎng)! | 幫助中心 裝配圖網(wǎng)zhuangpeitu.com!
裝配圖網(wǎng)
ImageVerifierCode 換一換
首頁 裝配圖網(wǎng) > 資源分類 > DOC文檔下載  

《C++程序設(shè)計(jì)》課程設(shè)計(jì)說明書

  • 資源ID:28470136       資源大小:165KB        全文頁數(shù):27頁
  • 資源格式: DOC        下載積分:15積分
快捷下載 游客一鍵下載
會員登錄下載
微信登錄下載
三方登錄下載: 微信開放平臺登錄 支付寶登錄   QQ登錄   微博登錄  
二維碼
微信掃一掃登錄
下載資源需要15積分
郵箱/手機(jī):
溫馨提示:
用戶名和密碼都是您填寫的郵箱或者手機(jī)號,方便查詢和重復(fù)下載(系統(tǒng)自動生成)
支付方式: 支付寶    微信支付   
驗(yàn)證碼:   換一換

 
賬號:
密碼:
驗(yàn)證碼:   換一換
  忘記密碼?
    
友情提示
2、PDF文件下載后,可能會被瀏覽器默認(rèn)打開,此種情況可以點(diǎn)擊瀏覽器菜單,保存網(wǎng)頁到桌面,就可以正常下載了。
3、本站不支持迅雷下載,請使用電腦自帶的IE瀏覽器,或者360瀏覽器、谷歌瀏覽器下載即可。
4、本站資源下載后的文檔和圖紙-無水印,預(yù)覽文檔經(jīng)過壓縮,下載后原文更清晰。
5、試題試卷類文檔,如果標(biāo)題沒有明確說明有答案則都視為沒有答案,請知曉。

《C++程序設(shè)計(jì)》課程設(shè)計(jì)說明書

C+程序設(shè)計(jì)課 程 設(shè) 計(jì) 說 明 書題目名稱:學(xué)生學(xué)號:學(xué)生姓名:指導(dǎo)老師:2011年3月25目 錄第一部分 基礎(chǔ)程序1一、程序代碼1二、運(yùn)行結(jié)果及分析16第二部分 綜合問題20一、需求分析20二、設(shè)計(jì)21三、編碼與調(diào)試22四、結(jié)果分析23五、參考資料24六、總結(jié)25第一部分 基礎(chǔ)程序一、 程序代碼(1) #include <iostream>using namespace std;const int max=100;void main()int smax,i,x,q,n=10; cout<<"輸入個有序數(shù)列"<<endl;for(i=0;i<n;i+)cin>>si;cout<<"數(shù)列為: "for(i=0;i<n;i+)cout<<si<<" " cout<<"輸入一個要插入的數(shù)"cin>>x;for(i=0;i<n;i+) if(x<si) q=i; break; else q=n; n+; for(i=n-2;i>=q;i-) si+1=si; sq=x; cout<<"輸出"<<n<<"個有序數(shù)列為" for(i=0;i<n;i+) cout<<si<<" " (2) #include <iostream>using namespace std;const int max=100;void main()int smax,i;int sum=0; cout<<"輸入個數(shù)"<<endl; for(i=0;i<20;i+) cin>>si;cout<<"數(shù)列為:"<<" "for(i=0;i<20;i+)cout<<si; for(i=0;i<20;i+)if(si%2=0)cout<<si <<" " sum=si+sum; cout<<"和為"<<sum; (3) #include <iostream>using namespace std;int lj(int i);void main () int result=0,n,i; cout<<"1+(1+2)+(1+2+3)+(1+2+.+n)"cout <<"輸入n:"<<endl;cin>>n;for(i=1;i<=n;i+)result=lj(i)+result;cout<<"和為"<<result<<endl;int lj(int i) int sum=0,a;for(a=1;a<=i;a+) sum=sum+a;return sum; (4) #include <iostream>using namespace std;double ss(int n);void main ()int i;cout<<"50-100的素?cái)?shù)有:" for(i=50;i<=100;i+)if(ss(i) cout<<i<<" "double ss(int n)int i;for(i=2;i<n;i+)if(n%i=0)break;if(i=n)return 1;else return 0;(5) #include <iostream>using namespace std;const int max=100;double aveage(int s);void main()int smax,i;double ave; cout<<"enter 10 students score"for(i=0;i<10;i+)cin>>si;ave=aveage(s);cout <<"ave is:"<<ave<<endl;double aveage(int s)int ave=0,i;for(i=0;i<10;i+)ave=ave+si;return double (ave)/10;(6) #include <iostream>using namespace std;double leg(char str);void main () char str81; cout <<"enter a char " cin>>str; leg(str); cout<<str;double leg(char str) int n,i,temp;n=strlen(str);for(i=0;i<n/2;i+) temp=stri; stri=strn-1-i; strn-1-i=temp;return *str;(7)#include <iostream>using namespace std;const int max=100;void main ()int n=10; int*p,smax,*max,*min;int sum=0;double ave;cout<<"enter "<<n<<" numbers"for(p=s;p<s+n;p+)cin>>*p;cout<<"number is: "for(p=s;p<s+n;p+)cout<<*p<<" "cout<<endl;max=s;min=s; for(p=s;p<s+n;p+)if(*p>*max)max=p; for(p=s;p<s+n;p+)if(*p<*min)min=p; cout<<"max is "<<*max<<endl;cout<<"min is "<<*min<<endl; for(p=s;p<s+n;p+)sum+=*p; ave=(1.0*sum)/n;cout<<"aveage is "<<ave<<endl;(8) #include <iostream>using namespace std;const int max=100;void main() char str181,str281; char *p,*q; cout <<"enter a string"<<endl; cin>>str1; cout<<"enter another string"<<endl; cin>>str2; for(p=str1;*p!=0;p+); for(q=str2;*p=*q;p+,q+); cout<<str1<<endl;(9) #include <iostream>using namespace std;class scoreprivate:int number; int computer;int English; double average;public: void inscore(double xx,double yy ,double zz); void showscore();void score:inscore(double xx,double yy,double zz)number=xx; computer=yy;English=zz;average=(English+computer)/2.0;void score:showscore()cout<<"number"<<" "<<"computer"<<" "<<"English"<<endl;cout<<number<< " "<<computer<<" "<< English<<endl;cout<<"average is : "<< average<<endl;void main()int x,y,z;int x1,y1,z1; score stu1,stu2,*p=&stu2;cout<<"enter number and computer score .English score"<<endl;cin>>x>>y>>z;cout<<"enter another number and computer score .English score"<<endl;cin>>x1>>y1>>z1; stu1.inscore(x,y,z);stu1.showscore(); stu2.inscore(x1,y1,z1);p->showscore(); (10) #include<iostream>using namespace std;class studentint num; char sname50; double score;public:void setdata();void display();double getscore()return score;void student:setdata()cout<<"enter students number:"<<endl;cin>>num;cout<<"enter students name:"<<endl;cin>>sname;cout<<"enter the score:"<<endl;cin>>score;void student:display()cout<<"number"<<" name"<<" "<<"score"<<" "<<endl;cout<<num<<" "<<sname<<" " <<score<<endl;class manageint i,num;student s80;public: void input(int n); void sort(); void output();void manage:input(int n)num=n;for(i=0;i<num;i+) si.setdata();void manage:sort() student temp; int pos,j;for(i=0;i<num;i+)pos=i;for( j=i;j<num;j+)if(sj.getscore()>spos.getscore()pos=j;if(pos!=j)temp=spos;spos=si;si=temp;void manage: output()sort();for(i=0;i<num;i+)si.display();void main()int n;manage M;cout<<"how many students do you want to enter:"<<endl;cin>>n;M.input(n);M.output(); (11) #include<iostream>#include<string>using namespace std;class objectpublic:char name50;int number;class book:public objectprivate:char autour50;public:void set(); void display();void book:set()cout<<"書名:"<<endl;cin>>name;cout<<"作者:"<<endl;cin>>autour;void book:display()cout<<"書名: "cout<<name<<endl;cout<<"作者: "cout<<autour<<endl;cout<<"書號: " cout<<number<<endl;class reader:public objectprivate:int max;public:void set(); void display();void reader:set()cout<<"讀者姓名:"<<endl; cin>>name; cout<<"最多借書數(shù)量:"<<endl;cin>>max;void reader:display() cout<<"讀者姓名: " cout<<name<<endl; cout<<"借書證號: " cout<<number<<endl; cout<<"最多借書數(shù)量: " cout<<max<<endl;void main()book p;reader q;cout<<"輸入書號:n"cin>>p.number;p.set();p.display();cout<<"輸入借書證號:n"cin>>q.number;q.set();q.display();(12)#include<iostream>#include<cmath>using namespace std;const double PI=3.14;class shapepublic:virtual double area()=0;class square:public shapepublic:square(int m);double area();private:int n;square:square(int m)n=m;double square:area()return n*n;class circle:public shapepublic:circle(double r);double area() ;private:double radius;circle:circle(double r)radius=r;double circle:area() return PI*radius*radius;class Chang:public shapepublic:Chang (int a,int b);double area();private:int x;int y;Chang:Chang(int a,int b)x=a;y=b;double Chang:area()return x*y;class Triangle:public shapepublic:Triangle(double x,double y,double z) ;double area();private:double a;double b;double c;Triangle:Triangle(double x,double y,double z)a=x;b=y;c=z;double Triangle:area()double m,s;m=(a+b+c)/2;s=sqrt(m*(m-a)*(m-b)*(m-c);return s;void main() int a,b,c,d,e,f,g; cout <<"輸入正方形邊長 " ;cin>>a; shape *s=new square(a); cout<<"正方形面積:"<<s->area()<<endl;delete s; cout <<" 輸入圓半徑" ;cin>>b; shape *p=new circle(b);cout<<"圓面積:"<<p->area()<<endl; delete p; cout <<" 輸入長,寬 " ;cin>>c>>d;shape *C=new C24hang(c,d);cout<<"長方形面積:"<<C->area()<<endl; delete C; cout <<" 輸入三條邊" ;cin>>e>>f>>g;shape *T=new Triangle(e,f,g);cout<<"三角形面積:"<<T->area()<<endl;delete T;(13) #include<iostream.h>const int maxsize=100;template<class T>void sort(T s,int n);void main()int i,n;int smaxsize;char m20;cout<<"enter a numbers:n"cin>>n;cout<<"enter "<<n<<" numbersn"for(i=0;i<n;i+)cin>>si;sort(s,n);cout<<"sorted numbers:"<<endl;for(i=0;i<n;i+)cout<<si<<" "cout<<endl;cout<<"enter a numbes:n"cin>>n;cout<<"enter "<<n<<" string:n"for(i=0;i<n;i+)cin>>mi; sort(m,n);cout<<"sorted char:"<<endl;for(i=0;i<n;i+)cout<<mi<<" " cout<<endl;template<class T>void sort(T s,int n)int i,j,pos;for(i=0;i<n-1;i+)pos=i;for(j=i;j<n;j+)if(sj>spos)pos=j;if(pos!=i)T t; t=si;si=spos;spos=t;(14) #include<iostream>#include<fstream>using namespace std;void main()char str100;int i=0;ifstream data("data.txt",ios:in);ofstream data1("data1.txt",ios:out);if(!data)cerr<<"cannor open file!"<<endl;abort();while(!data.eof()data.getline(str,100);data1<<+i<<"t"<<str<<endl;cout<<str<<endl;data.close();data1.close();cout<<"共"<<i<<" 行"二、 運(yùn)行結(jié)果及分析第一題:分析:需要 n+ 不然 丟一個數(shù)。輸入10個有序數(shù)列1 2 3 4 5 6 7 8 9 10數(shù)列為 : 1 2 3 4 5 6 7 8 9 10 輸入一個要插入的數(shù)100輸出11個有序數(shù)列為 1 2 3 4 5 6 7 8 9 10 100 Press any key to continue第二題: 輸入20個數(shù)1 2 3 4 5 6 7 8 9 1011 12 13 14 15 16 17 18 19 20數(shù)列為 : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20偶數(shù)有: 2 4 6 8 10 12 14 16 18 20 和為110Press any key to continue第三題:1+(1+2)+(1+2+3)+.+(1+2+3+.n)輸入n:5和為35Press any key to continue第四題:50-100之間的素?cái)?shù)有:53 59 61 67 71 73 79 83 89 97Press any key to continue第五題:enter 10 students score1 2 3 4 5 6 7 8 9 10ave is:5.5Press any key to continue第六題:分析:先求串長 再將元素bi與 bn-i互換結(jié)果:enter a char:abcddcbaPress any key to continue第七題:分析enter 10 numbers1 2 3 4 5 6 7 8 9 10number is: 1 2 3 4 5 6 7 8 9 10max is 10min is 1aveage is 5.5Press any key to continue第八題:分析:先找到 0再把第二個串的首地址接到0上。enter a stringcongenter another stringbincongbinPress any key to continue第九題:分析:computer、english、average 。number是私有變量指針型“score stu1,stu2,*p=&stu2; p->showscore();”結(jié)果:enter number and computer score .English score1 99 100enter another number and computer score .English score2 78 98number computer English1 99 100average is : 99.5number computer English2 78 98average is : 88Press any key to continue第十題:分析:enter number and computer score .English score1 99 100enter another number and computer score .English score2 78 98number computer English1 99 100average is : 99.5number computer English2 78 98average is : 88Press any key to continue第十一題:分析:輸入書號:1書名:sheeeeee作者:cong書名: sheeeeee作者: cong書號: 1輸入借書證號:2008讀者姓名:bin最多借書數(shù)量:5讀者姓名: bin借書證號: 2008最多借書數(shù)量: 5Press any key to continue第十二題:分析:輸入正方形邊長 2正方形面積:4 輸入 圓半徑 2圓面積:12.56 輸入 長, 寬 2 3長方形面積:6 輸入三條邊 3 4 5三角形面積:6Press any key to continue第十三題:分析:enter a numbers:2enter 2 numbers1223sorted numbers:23 12enter a numbes:2enter 2 string:d gsorted char:g dPress any key to continue第十四題:分析:要新建 data。Txt文件夾congbin共 2 行Press any key to continue第二部分 綜合問題一、需求分析需求分析即問題的描述,根據(jù)設(shè)計(jì)題目的要求,充分地分析和理解問題,明確問題要求做什么,限制條件是什么。在確定解決方案框架過程中,綜合考慮系統(tǒng)功能,考慮怎樣使系統(tǒng)結(jié)構(gòu)清晰、合理、簡單和易于調(diào)試。最后確定系統(tǒng)的功能模塊以及模塊之間的調(diào)用關(guān)系。 二、設(shè)計(jì)分析對問題描述中涉及的操作對象定義相應(yīng)的類,并按照以數(shù)據(jù)結(jié)構(gòu)為中心的原則劃分模塊,定義主程序模塊和各抽象數(shù)據(jù)類型。邏輯設(shè)計(jì)的結(jié)果應(yīng)寫出每個抽象數(shù)據(jù)類型的定義(包括數(shù)據(jù)結(jié)構(gòu)的描述和每個基本操作的功能說明),各個主要模塊的算法,定義相應(yīng)的存儲結(jié)構(gòu)并寫出偽碼算法。抽象數(shù)據(jù)類型的實(shí)現(xiàn)盡可能做到數(shù)據(jù)封裝,基本操作的規(guī)格說明盡可能明確具體。確定每一個模塊的算法流程,畫出流程圖。把詳細(xì)設(shè)計(jì)的結(jié)果進(jìn)一步求精為程序設(shè)計(jì)語言程序,同時加入一些注解,使程序中邏輯概念清楚;三、編碼與調(diào)試采用自底向上,分模塊進(jìn)行,即先調(diào)試低層函數(shù)。能夠熟練掌握調(diào)試工具的各種功能,設(shè)計(jì)測試數(shù)據(jù)確定疑點(diǎn),通過修改程序來證實(shí)它。調(diào)試正確后,認(rèn)真整理源程序及其注釋,形成格式和風(fēng)格良好的源程序清單和結(jié)果;根據(jù)系統(tǒng)功能選擇有代表性的數(shù)據(jù)進(jìn)行測試,發(fā)現(xiàn)系統(tǒng)存在的不足并逐步改進(jìn)。注意:此部分不需要粘貼所有程序代碼,對于程序主要運(yùn)行界面需要粘貼(如:主界面、查詢界面等)。四、結(jié)果分析程序運(yùn)行結(jié)果包括正確的輸入及其輸出結(jié)果和含有錯誤的輸入及其輸出結(jié)果,并加以文字分析。五、參考資料所查閱的書籍或資料按下列例子中的格式書寫:1王國榮編Active Server Page &Web數(shù)據(jù)庫人民郵電出版社2阮家棟等編WEB數(shù)據(jù)庫技術(shù)科學(xué)出版社2002.33賀利堅(jiān)等編數(shù)據(jù)庫技術(shù)及應(yīng)用北京希望電子出版社2002.74魏應(yīng)彬等網(wǎng)頁設(shè)計(jì)與WEB數(shù)據(jù)庫發(fā)布技術(shù)清華大學(xué)出版社2001.15張文增, 孫振國, 趙冬斌等基于Web數(shù)據(jù)庫的子集合查詢技術(shù)計(jì)算機(jī)應(yīng)用2002 Vol.22 No.1六、總結(jié)1經(jīng)驗(yàn)2存在的問題及進(jìn)一步改進(jìn)

注意事項(xiàng)

本文(《C++程序設(shè)計(jì)》課程設(shè)計(jì)說明書)為本站會員(仙***)主動上傳,裝配圖網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對上載內(nèi)容本身不做任何修改或編輯。 若此文所含內(nèi)容侵犯了您的版權(quán)或隱私,請立即通知裝配圖網(wǎng)(點(diǎn)擊聯(lián)系客服),我們立即給予刪除!

溫馨提示:如果因?yàn)榫W(wǎng)速或其他原因下載失敗請重新下載,重復(fù)下載不扣分。




關(guān)于我們 - 網(wǎng)站聲明 - 網(wǎng)站地圖 - 資源地圖 - 友情鏈接 - 網(wǎng)站客服 - 聯(lián)系我們

copyright@ 2023-2025  zhuangpeitu.com 裝配圖網(wǎng)版權(quán)所有   聯(lián)系電話:18123376007

備案號:ICP2024067431-1 川公網(wǎng)安備51140202000466號


本站為文檔C2C交易模式,即用戶上傳的文檔直接被用戶下載,本站只是中間服務(wù)平臺,本站所有文檔下載所得的收益歸上傳人(含作者)所有。裝配圖網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對上載內(nèi)容本身不做任何修改或編輯。若文檔所含內(nèi)容侵犯了您的版權(quán)或隱私,請立即通知裝配圖網(wǎng),我們立即給予刪除!