|
|
 |
|
|
|
|
Write a top-down design and a C++ program to read a single floating point valuethe distance to the rainbowand compute the height of the rainbow. The program should print the distance to the rainbow and its height with phrases that identify which number is which. Display the floating point values to four decimal places. Format your program with consistent indentation, and use appropriate comments and meaningful identifiers. If you are using an interactive system, write the program so that it prompts the user for the input value. |
|
|
|
|
|
|
|
|
3. Sometimes you can see a second, fainter rainbow outside a bright rainbow. This second rainbow has a magic angle of 52.25 degrees. Modify the program in Problem 2 so that it prints the height of the main rainbow, the height of the secondary rainbow, and the distance to the main rainbow, with a phrase identifying each of the numbers. |
|
|
|
|
|
|
|
|
1. In the TestAverage problem, look at the module structure chart and identify each module as abstract or concrete. |
|
|
|
|
|
|
|
|
2. Redraw the module structure chart for the TestAverage problem using Prepare File for Reading, Get and Echo Data, Find Weighted Average, and Print Weighted Average as level 1 modules. Add any appropriate modules at levels below these modules. |
|
|
|
|
|