Lecture6 (Mar 27 2016)
Lecture6 (Mar 27 2016)
Lecture #6
Spring 2016
2
Case Study: Taxi Changes ASTU
3
Step 2: Develop a Solution ASTU
4
Step 2: Develop a Solution(Detailed Algorithm) ASTU
6
Formatting Number for Program Output ASTU
setw(5) 2.366 | 2.37| Field width of five with two decimal digits.
fixed
setprecision(2)
7
Formatting Number for Program Output ASTU
9
Formatting Number for Program Output ASTU
10
Formatting Number for Program Output ASTU
11
Formatting Number for Program Output ASTU
12
Cast Operator ASTU
13
Cast Operator ASTU
14
Case Study: Buying Pizza ASTU
15
Case Study: Buying Pizza ASTU
16
Case Study: Buying Pizza ASTU
17
Case Study: Buying Pizza ASTU
18
Case Study: Buying Pizza ASTU
19
Case Study: Buying Pizza ASTU
20
Case Study: Buying Pizza ASTU
22
Case Study: Buying Pizza ASTU
23
Case Study: Buying Pizza ASTU
24
General Problems ASTU
25
General Problems ASTU
26
Assignment #1 ASTU
Write, test, and run a C++ program that calculates and displays the
impact speed of the first three bounces and the rebound height of
each bounce.
Test your program by using an initial height of 2.0 meters.
Run the program twice, and compare the results for dropping the
ball on Earth (g = 9.81 m/s2) and on the moon (g = 1.67 m/s2).
27