C++ CHAPTER 2 SUMMARY

1Use meaningful names for cariables.

2Be sure to check that variables are declared to be of the correct type.

3Be sure that variables are initialized before the program attempts to use their value .This can be done when the cariable is declared or with an assignment statemnet before the variable is first used.

4.Always include a prompt line in a program whenever the user is explected to enter data from the keyboard ,and always echo the user's input.

5.Boolean expressions are evaluated similar to the way arithmetic expressions are evaluated.

6Most modern compilers have a bool type having the values true and false.

7The C++ branching statements are the if-else statement and the switch statement.

8The C++ loop statements are the while ,do-while,and for statements.

9A loop can be ended early with a break statement .A single iteration of  a loop body may be ended early with a continue statement.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值