//                 In-Class Assignment 2
//          Expressions and assignment statements
//
// 1. Make a copy of this program (use the Edit/Copy command
//    in your Browser). Paste the copy of this program (use the
//    Edit/Paste command) into your C++ program editor. Save
//    the program using the name "expr.cpp".
//
// 2. Run the program and then answer the following 3 questions
//    for each problem in the program.
//
//    Which parts of the problem (a, b, or c) give the same answer?
//    Which give different answers?
//    Why?

#include <iostream.h>

int main()
{
   int intVar;
   float floatVar;

// Problem 1 - Precedence
   cout << "Problem 1a = " << 2 + 3 * 4 << endl;
   cout << "Problem 1b = " << (2 + 3) * 4 << endl;
   cout << "Problem 1c = " << 2 + (3 * 4) << endl;
   cout << endl;

// Problem 2
   cout << "Problem 2a = " << 7 / 3 << endl;
   cout << "Problem 2b = " << 7.0 / 3.0 << endl;
   cout << endl;

// Problem 3
   intVar = 7.0 / 3.0;
   floatVar = 7.0 / 3.0;
   cout << "Problem 3a = " << intVar << endl;
   cout << "Problem 3b = " << floatVar << endl;
   cout << endl;

// Signal successful termination
   return 0;
}
