EEGR-409-001, C Programming Applications, Assingment #2, Due:  Weds, Sept 9, '09

1.  Write a simple calculator program which accepts an input of the form of a op1 b op2 c where a, b and c are floats and  op1 and op2 are chars limited to '+', '-', '*' and '/'.   Accept inputs and calculate outputs until the user provides a distinctive operator (or similar).

Consider;

   9.5 + 2.5 / 6.0    
   
There are two interpretations, one better than the other.  You may calculate this as 2.0, but it would be better if it were caculated as 9.916.

Avoid division by zero.

2.  Prompt the user for an integer and a char and then draw something like this in response to 6 *;

*
**
***
****
*****
******

Note there are six lines, with the number of * ranging from 1 to 6.  I don't want to waste the paper illustrating the output to the command "55 !"

Extra Credit;

Draw as a triangle;

     * 
    * *
   *   *   // I don't know how difficult this might be
  *     *
 *       *
***********

3.  Write a program that reads a positive number from the user in the range of 0 - 255 and prints this as a binary number.

For example;    73     0100_1001
    
4. Generate a table evaluating the function;

	y = exp(-x) * cos(x)

at NUM_PTS equidistant points over the range x = 0 to 2 * PI  You might debug with NUM_PTS set to 20.  Once you get it going, you can set NUM_PTS to a higher value, say 100.  

The output should be separated by a comma.  For example;

	0.513,	0.234

Write this to a file.  Then, use a spreadsheet program to import this file and plot it.

5.  Develop a program to use trial and error to solve;

	x = e^x - 1.5
	
6.  Prompt the user for an integer.  Print this out as a Roman Numeral.