CS100 Written Assignment Solutions
This page contains links to the solutions of the written assignments.
Assignment Solutions
Written Assignment 1:
Program 1.1 : Compute various sin and cos values using trigonometric identities.
Program 1.2 : Seconds to hours-minutes-seconds.
Program 1.3 : The maximum of the cos(x) on finite set.
Program 1.4 : Bounding diamond.
Written Assignment 2:
Program 2.1 : Compute least k such that cotan(pi/2^k) > 1000 .
Program 2.2 : Find integers x <= 1000 that make x(x+180) a perfect square.
Program 2.3 : Summations that estimate pi.
Program 2.4 : Draws a cross-shaped grid.
Written Assignment 3:
Program 3.1 : Questions about 3-die rolls.
Program 3.2 : Nearer to center than edge.
Program 3.3 : Confirm that there are at least seven integers x that make x(x+180) a perfect square.
Program 3.4 : Draws a triangular grid.
Written Assignment 4:
Program 4.1
Program 4.2
Program 4.3
Program 4.4
Program 4.5
Written Assignment 5:
Program 5.1 : Part 1 - Methods to add to the Quadratic class.
Program 5.1 : Part 2 - The main() method in the Quadratic class.
Program 5.2 : Part 1 - Methods to add to the Quadratic class.
Program 5.2 : Part 2 - A new class for solving 5.2 .
Program 5.3 : Methods to add to the Quadratic class.
Program 5.4 : Methods to add to the CSMath class.
Written Assignment 6:
Program 6.1 : Part 1 - Methods to add to the Point class.
Program 6.1 : Part 2 - The main() method and class for 6.1 .
Program 6.2 : Part 1 - Methods to add to the Point class.
Program 6.2 : Part 2 - The main() method and class for 6.2 .
Program 6.3 : The main() method and class for 6.3 .
Program 6.4 : Part 1 - Methods to add to the Line class.
Program 6.4 : Part 2 - The main() method and class for 6.4 .
Written Assignment 7:
Program 7.1 : The main class for W7.
Program 7.2 : A class to draw lines between all possible pairs of random points.
Written Assignment 8:
Program 8.1 : The solution to W8.
Written Assignment 9:
Program 9.1 : Method to be added to the Polynomial class.
Program 9.2 : Class with main method.
Program 9.3 : Part 1 - Define a MagicSquareOps class, to put our method in.
Program 9.3 : Part 2 - Class with main method to demonstrate IsMagicSquare method.
Program 9.4 : Class with main method to set up an n-by-n double array.
Written Assignment 10:
Program 10.1 : Benchmarks two methods for the "averaging" operation on an array.
Program 10.2 : Benchmarks the two Array Set Up methods.
Program 10.3 : Illustrates the Company class.
Written Assignment 11:
The solutions for W11.
Written Assignment 12:
The solutions for W12.
If you have any questions, contact your friendly Consultant in Carpenter Hall!
Return to CS100 Homepage
If you have any questions or comments about this page, please contact me:
kyparlis@cs.cornell.edu
Latest update: 25 August 1997