ImageVerifierCode 换一换
格式:DOC , 页数:73 ,大小:333KB ,
资源ID:3550435      下载积分:20 文钱
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,省得不是一点点
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.wenke99.com/d-3550435.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: QQ登录   微博登录 

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(C++_Primer_Plus(第五版)编程习题解答.doc)为本站会员(hw****26)主动上传,文客久久仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知文客久久(发送邮件至hr@wenke99.com或直接QQ联系客服),我们立即给予删除!

C++_Primer_Plus(第五版)编程习题解答.doc

1、Solutions for Programming Exercises in C+ Primer Plus, 5th EditionSP 1 of 73 September 2, 2004Chapter 2/ pe2-2.cpp#include int main(void)using namespace std;cout furlongs;double feet;feet = 220 * furlongs;cout using namespace std;void mice();void run();int main()mice();mice();run();run();return 0;vo

2、id mice()cout double C_to_F(double);int main()Solutions for Programming Exercises in C+ Primer Plus, 5th EditionSP 2 of 73 September 2, 2004using namespace std;cout C;double F;F = C_to_F(C);cout const int Inch_Per_Foot = 12;int main(void)using namespace std;/ Note: some environments dont support the

3、 backspace charactercout ht_inch;int ht_feet = ht_inch / Inch_Per_Foot;int rm_inch = ht_inch % Inch_Per_Foot;cout const double MINS_PER_DEG = 60.0;const double SECS_PER_MIN = 60.0;int main()using namespace std;int degrees;int minutes;int seconds;double latitude;cout degrees;cout minutes;cout seconds

4、;latitude = degrees + (minutes + seconds / SECS_PER_MIN)/MINS_PER_DEG;cout int main(void)using namespace std;cout miles;cout gallons;cout const double KM100_TO_MILES = 62.14;const double LITERS_PER_GALLON = 3.875;int main ( void )using namespace std;double euro_rating;double us_rating;cout euro_rati

5、ng;/ divide by LITER_PER_GALLON to get gallons per 100-km/ divide by KM100_TO_MILES to get gallons per mile/ invert result to get miles per gallonus_rating = (LITERS_PER_GALLON * KM100_TO_MILES) / euro_rating;cout #include int main()using namespace std;string name;string dessert;cout #include const

6、int SIZE = 20;int main()using namespace std;char firstNameSIZE;char lastNameSIZE;char fullName2*SIZE + 1;cout firstName; cout lastName; strncpy(fullName,lastName,SIZE);strcat(fullName, “, “);strncat(fullName, firstName, SIZE);fullNameSIZE - 1 = 0;cout Solutions for Programming Exercises in C+ Primer

7、 Plus, 5th EditionSP 5 of 73 September 2, 2004int main()using namespace std; /introduces namespace stdCandyBar snack = “Mocha Munch“, 2.3, 350 ;cout const int Slen = 70;struct pizza char nameSlen;float diameter;float weight;int main(void)using namespace std;pizza pie;cout pie.diameter;cout pie.weigh

8、t;cout int main(void)using namespace std;double sum = 0.0;Solutions for Programming Exercises in C+ Primer Plus, 5th EditionSP 6 of 73 September 2, 2004double in;cout in;while (in != 0) sum += in;cout in;cout const int MONTHS = 12;const char * monthsMONTHS = “January“, “February“, “March“, “April“,“

9、May“, “June“, “July“, “August“, “September“,“October“, “November“, “December“;int main()using namespace std; /introduces namespace stdint salesMONTHS;int month;cout salesmonth;double total = 0.0;for (month = 0; month struct car char name20; int year;int main(void)using namespace std;int n;cout n;whi

10、le(cin.get() != n) / get rid of rest of line;car * pc = new car n;int i;for (i = 0; i pci.year;while(cin.get() != n) / get rid of rest of line;cout #include / prototype for strcmp()const int STR_LIM = 50;int main()using namespace std;char wordSTR_LIM;int count = 0;cout word cout int main()using name

11、space std; /introduces namespace stdint rows;Solutions for Programming Exercises in C+ Primer Plus, 5th EditionSP 8 of 73 September 2, 2004int row;int col;int periods;cout rows;for (row = 1; row #include int main( )using namespace std; /introduces namespace stdchar ch;cin.get(ch);while(ch != )if (!i

12、sdigit(ch)if (isupper(ch)ch = tolower(ch);else if (islower(ch)ch = toupper(ch);cout int main(void)Solutions for Programming Exercises in C+ Primer Plus, 5th EditionSP 9 of 73 September 2, 2004using namespace std;cout ch;while (ch != c switch (ch)case c : cout const double LEV1 = 5000;const double LE

13、V2 = 15000;const double LEV3 = 35000;const double RATE1 = 0.10;const double RATE2 = 0.15;const double RATE3 = 0.20;int main( )using namespace std;double income;double tax;cout income;if (income #include int main()using namespace std;string word;char ch;int vowel = 0;int consonant = 0;int other = 0;c

14、out word;while ( word != “q“)ch = tolower(word0);if (isalpha(ch)if (ch = a | ch = e | ch = i | ch = o | ch = u)vowel+;elseconsonant+;elseother+;cin word;cout #include / file I/O suppport#include / support for exit()const int SIZE = 60;int main()using namespace std;char filenameSIZE;char ch;ifstream inFile; / object for handling file inputcout “Enter name of data file: “;cin.getline(filename, SIZE);inFile.open(filename); / associate inFile with a fileif (!inFile.is_open() / failed to open file

Copyright © 2018-2021 Wenke99.com All rights reserved

工信部备案号浙ICP备20026746号-2  

公安局备案号:浙公网安备33038302330469号

本站为C2C交文档易平台,即用户上传的文档直接卖给下载用户,本站只是网络服务中间平台,所有原创文档下载所得归上传人所有,若您发现上传作品侵犯了您的权利,请立刻联系网站客服并提供证据,平台将在3个工作日内予以改正。