- Suppose that there are two variables: x and y. x stores “Beer” and y stores
“Water.” How can you swap the values of the two variables to let x store
“Water” and y store “Beer”?
- Suppose that there are three variables: Purchase, TaxRate, and Payment.
Purchase stores the money value of the purchased merchandise, and
TaxRate stores the state sales tax rate. Write an arithmetic operation to let
Payment store the payment amount after tax.
- Write an if-then-
statement using structured English for the GPA
scheme: Grade “A” = 4.0 points, grade “B” = 3.0 points, grade “C” = 2.0 points,
grade “D” = 1.0 point, and grade “F” = 0 points.
- Write a loop statement using structured English to let the computer list 0.3,
0.6, 0.9, 1.2, 1.5, …, 30.
Chapter 2 Exercises
- Read the following C program and complete it by filling in the blanks:
4 void main()
6 ____________ i;
7 double sales;
Critical Thinking (250 word minimum and At least one APA formatted citation/reference): Explain two strengths and two weaknesses of C++. Include and give examples of how each strength and weakness could influence an IT environment