Due Date | Chapter | Collaboration? | Problems |
---|---|---|---|
Wed., Sept. 2 | Sup. Prob. | 1, 2 | |
Fri., Sept. 4 | Sup. Prob. | 3, 4 | |
Mon., Sept. 7 | Sup. Prob. | 5 | |
Fri., Sept. 11 | Chapter 1 | 2, 3, 7, 9 | |
Wed., Sept. 30 | Chapter 2 | 5bc, 7 | |
Chapter 4 | 15 | ||
Fri., Oct. 2 | Sup. Prob. | 6 | |
Wed., Oct. 28 | Sup. Prob. | 7 | |
Mon., Nov. 23 | Chapter 8 | 4, 5, 6, 7, 11, 12, 13, 14, 17, 29 | |
Wed., Dec. 2 | Take-Home Test | Part A: written problems | |
Fri., Dec. 4 | Take-Home Test | Part B: C++ program | |
// Henry M. Walker // Box Y-06 // Assignment for Wednesday, September 2Also, a comment is needed for every definition of a C++ function, method, or class, stating in English what that program unit is supposed to do.
if ((no_comments) || (no_evidence_of_compilation) || (no_test_runs) || (no_commentary_on_correctness)) return (no_grade);
A triangle cannot be formed from sides of these lengths. The triangle is equilateral. The triangle is isosceles (but not equilateral). The triangle is scalene (no two sides are equal).
Write a program that reads an initial amount A and the annual interest rate R, and then computes and prints the monthly bank balance until the balance has doubled. The number of the month and the monthly balances should be printed in a table. For example, if $100.00 were deposited at a 12% annual interest, the start of the output might look as follows:
Month Balance 0 100.00 1 101.00 2 102.01 ...
To compute the greatest common divisor of two positive integers M and N, the Euclidean algorithms may be described as follows:
Example: To find gcd(66, 24):
Programming Note: Arrays are not needed in this problem. Rather, maintain current values for M, N, and the remainder R, and update each value from one iteration to the next.
Expand class List to include the following operations:
Expand class OrderedList to include the following operations:
Check that both print_last and largest work for both class List and class OrderedList. Of course, delete_duplicates will be defined only for class OrderedList.
Note: While you will need to add the above methods to these classes, the current implementation should not be changed in any way. Rather, you only will need to perform additions to the class definitions and corresponding new implementation. The current methods may not be altered in this assignment.
For comparison, this assignment will assume that main memory is large enough to store only 1000 integers at a time. Thus, it will be necessary to generate initial runs of the data and to merge successive runs to form a final sorted file. In order to compare various methods, this assignment involves the following steps:
During the formal process for submitting programs, for this problem you should run the Unix utility diff to compare your output file with ~walker/301/integer.file-ascending. Since diff will report any differences between your file and the correctly sorted data, this will provide an efficient way to check the output of your program. You should not print out a copy of the sorted data; a check with diff provides an effective mechanism for saving a few trees.
This document is available on the World Wide Web as
http://www.math.grin.edu/~walker/courses/301.fa98/assignments.html