Date: Mon, 11 Nov 1996 17:13:18 GMT Server: NCSA/1.5 Content-type: text/html Last-modified: Wed, 11 Sep 1996 21:37:48 GMT Content-length: 3481 Program 1 - CS 302 Fall 1996 - Section 4

CS 302 Fall 1996 - Section 4

Algebraic Language Programming in C++

Instructor: Milo M. Martin (milo@cs.wisc.edu)



Program 1

Due Wednesday, September 18, 1996



In program 1 you will be writing your first program. You may write on your program to execute one of the following three formulas:

For this assignment, all input comes from the keyboard and output is sent to the display. Remember to prompt for and read the necessary input variables. It is also a good idea to check your results with a calculator to make sure you don't have any logic errors! The calculations should be done using double variable types. The answers should be displayed only with a reasonable number of decimal places.

You should use your U:\PROGRAMS\PROG1 directory to hold the files for this assignment.

Turn in the assignment following the guidelines given in Turning in Assignments. Turn into me a print out of your code and a number of test runs. Staple all of your pages together. See below on how to print out your output. To avoid mixing up your output with others, at the beginning of your program, have it print your name and section using cout.

Commenting Your Program:

Comments are required for this and all subsequent programs. They are used to document your program, but are ignored by the compiler. As you develop your program, comments are added for clarification and explanation. In C++ comments follow after // and continue only to the end of the line. You may also use C comments, which are between /* and */ and can span several lines. Comments are found at the top of the program, including:

In the code place comments:

Printing Your Output

After your program has finished is should say "inactive" at the top of the output window. When it says this, click on the upper lefthand corner of the window to activate a pull down menu. Select Print from this menu, then click ok.
Created by Dan Yao , Dave Zimmermann & Milo Martin