C++ language
1
1. Writing Algorithms / Pseudocode
Page 25 – “Math” problems
Previous Assignment: Working with the Exercises at the end of chapter 1, can you do the math? Complete the following exercises as math problems. (In other words, use the information given in the book and below to find the answer. SHOW YOUR STEPS/ WORK – do work on paper, not in your head
New Assignment: Write the steps (algorithm/pseudocode) for the following. First, confirm that you worked the problems correctly the first time. If not, rework. Using the steps you used on the problems, and the method we showed in class, write the algorithm to include inputs, processes, and outputs. (Get…Do…Print) Write as formulas(s) when possible.
#15. Use the data given in the text
#16. 3 quarters, 1 dime, 0 nickels, 4 pennies
#17. Radius = 6 inches; Price = $10
#18. Original Cost = $100
#20. Area = 1800 Square yards; No. of applications = 4; Trees = 2
#24. Use the data given in the text
2.Page 25 # 15 (weighted.cpp) & 16 (pennies.cpp). Using Template, copy typed (corrected) algorithm into body of code. Place // in front of each line to comment it out. After each comment, write the code necessary to complete the step. Double space. Code next step, etc… Compile, debug, execute your code.
Template:
//Yourname prog_name.cpp ________________ ________________
//Fall 2017
//Assignment # :
// Preprocessor directives:
#include <iostream>
using namespace std;
// Named constant definitions (and function declarations):
// Main program:
int main()
{
// Variable declarations:
// Function body:
return 0;
} // end function main