UMBC CMSC104

Project 1 Due: 18 Oct

Requirements Specfication

Your program must do the following:
  1. Prompt the user for two decimal signed integers (non-zero).
  2. If the user enters a zero, you must make them re-enter another number until they enter a valid number.
  3. Add the two numbers and display the result.
  4. Subtract the second number from the first and display the result.
  5. Multiply the two numbers and display the answer.
  6. Divide the smaller number into the larger number and display the quotient and remainder.

Name the source code file: proj1.c

Submission

Email the source file (the .c file) to the TA at pras1@umbc.edu.

The subject of the email should be "CMSC104 Project 1". This must be an exact match for the TA to be able to filter the mail and put your work in the correct folder!

Example Output 1

In the following example, the program displays what is in Blue and the user types what is in Red.

Enter a non-zero number:  0
Sorry, the number must not be a zero!
Enter a non-zero number:
34 Enter a non-zero number: 1 34 + 1 = 35 34 - 1 = 33 34 * 1 = 34 34 / 1 = 34 remainder 0

Example Output 2

In the following example, the program displays what is in Blue and the user types what is in Red.

Enter a non-zero number:  5
Enter a non-zero number:  11
5 + 11 = 16
5 - 11 = -6
5 * 11 = 55
11 / 5 = 2 remainder 1

Caution

You do not know what the values will be or the order that they will arrive! The smallest one can be either the first one or the second one.

Program Header Comment Block

Use the following comment block at the beginning of your source code:

/* 
** Filename:       proj1.c
** Name:           Ima Student
** SSAN:           6789  
** Date:           3 Feb 2001
** Course:         CMSC-104 Section XXX 
** Description:    (Your psuedocode goes here.  Must be detailed)
** Notes:          (As needed, such has how to compile)
*/
P.S. It must be your name and the last four digits of your SSAN! Make sure to include your section number.

Remember, when designing your psuedocode, try to write it like you were explaining it to your 10-year old brother or sister. There is several things here that are similiar to the notes in Lecture 11!


UMBC CMSC104 CSEE | CMSC104 |