CSci 151                                                             Spring 2015


                 Lab Assignment 4: Selection and Repetition


Develop a C++ program to perform basic arithmetic operations. Use your leo email
name(e.g. bBemer, but not lab4) as the source file name. Attach this file to an 
email sent tom.brown at the domain tamuc.edu on or before Tuesday 24 March. 
Include our course code(CS151), your leomailName, and the assignment number(#4)
in the subject of this email. 

Steps:
1. Define two variables for operands in integer arithmetic operations, 
   another variable representing an arithmetic operator (+, -, *, /),
   variable(s) as needed for a result (sum, difference, product, quotient, 
   remainder), and a control variable to signal loop termination.

2. Initialize the loop control variable (to indicate an arithmetic operation 
   is allowed);
   
3. Repeat the following steps for each arithmetic operation:
     
     Input two operand values to use with either addition, subtraction,  
        multiplication or division, and input an operator code;

     Test the operator code:
        when '+', compute the sum of the two operands,
        when '-', compute the difference, 
        when '*', compute the product, and 
        when '/', then
           test to ensure the divisor operand is not zero before a divide
              for an integer quotient and do a modulus operation for the
              remainder; 
           otherwise indicate division by zero would cause an error;
-
    Output a labeled result for either sum, difference, product, quotient
    with the remainder or a zero-divide exception message. 
  
4. Prompt and input a loop control variable value to show whether to 
   continue computations.

Notes:
1. Class exercises provide background and examples for this assignment. Our 
   Webpage has links to program examples and tutorials that may be useful.
   It is recommended that you analyze and implement the exercises and examples.
   By adapting fragments of these examples to the problem to be solved, it 
   should be possible to obtain a correct solution.
2. To maximize points earned, submit a "deliverable product" on or before the
   due date.