2015C上机实践题汇总.doc

  1. 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
  2. 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  3. 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
2015 C++程序设计上机实践题 Chapter 1 熟悉VC的开发环境 熟悉编译、运行C++程序的基本过程。 Example: #include iostream using namespace std; int main() { int a,b; a = 627; b = 365; couta+b; return 0; } Chapter 2 继续熟悉VC开发环境,能独立开发,编译,运行程序。 熟悉C++程序结构 编写程序理解declaration, variable, expression,, +的语法规则。 Arithmetic expression Book p64-65 2,3,5,6,8 编程:定义两个Char型变量,分别赋值’a’,’b’。实现大小写字母转换,并输出,即变量输出值应为’A’,’B’。 Chapter 3 Type coercion and type casting Function call Output function String function P104-105 2,6,7,10,12 上机验证以下表达式的运算结果: char a; int b; a = ‘2’; b = 3; int c; c = a +b; // please print the value of a, b and c float d; d = float(c)/b; //please print the value of b,c and d. Chapter 4 Input from keyboard File Operation 请完成以下程序,并测试运行结果 #include iostream using namespace std; int main () { char char1; char char2; char char3; char char4; cout Input four characters. Press Return. endl; //please use cin and to read four characters cout char1 char2 char3 char4; return 0; } 请完成以下程序,并测试运行结果 #include iostream using namespace std; int main () { char char1; char char2; char char3; char char4; cout Input four characters. Press Return. endl; // please use get function to read four characters . cout char1 char2 char3 char4; return 0; } 请输入不同的值,并测试运行结果 第一组值为:2 3 4回车 5 6 7回车20 30回车 第二组值为:2,3,4回车 5,6,7回车 20,30回车 #include iostream using namespace std; int main () { cout inter the values as shown endl; int a, b, c, d, e, f, g, h; cin a b c; cin.ignore(80, \n); cin d e f; cin.ignore(80, \n); cin g h; cout a a b b c c endl; cout d d e e f f endl; cout g g h h endl; return 0; } Book P148 10,11 Book P149 2 Chapter 5 Rational and logical expression BOOK P194-P195 2,3,7,10,11,12 Programming Problems Book P197 2 Programming Problems Book P198 8 有一函数 -1 (x0) y={

文档评论(0)

xiaozu + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档