UMBC CMSC201, Computer Science I, Fall 1994
Sections 0101, 0102 and Honors
8 Step Plan for Project 2
If you find Project 2 large and intimidating, you
should follow the following plan of attack and
implement the project incrementally.
The 8 Steps
- Write a program that takes a real value x from
the user and prints out sin(x).
- Add a for loop to the program, so it prints out
sin(0*PI/32.0), sin(PI/32.0), sin(2*PI/32.0),
sin(3*PI/32.0), ..., sin(64*PI/32.0).
- Modify the program above to calculate the number
of asterisks you want to print out for each of the 65 lines.
You have to round to the nearest integer.
The number could be positive or negative.
Store this number in a variable n.
Check your program.
- Write a separate program that takes an integer
n from the user and prints out that many asterisks
in one line.
- Modify this second program, so that n could be
positive or negative and you plot the asterisks on the
correct side of the x-axis. Plot the x-axis too.
- Combine the two programs, so now you are plotting the sine curve.
- Change the program to allow the user to enter the amplitude.
- Change the program to allow the user to enter the frequency.
Thu Oct 6 09:35:14 EDT 1994
Richard Chang, email@example.com