//Programmer: Bo Bayles  Date: 14 September 2004
//File: lab4.cpp         Class: CS54 C
//Purpose: This program will calculate the interest rate a customer
// receives based on user input for amount of money deposited and
// duration.

#include <iostream>
using namespace std;

int main()
{
  int iAmount, iDuration;

  cout << "This program calculates the interest rate you will receive "
       << "on a cash deposit." << endl;

  cout << "\n Enter the whole dollar amount of your deposit: $";
  cin >> iAmount;

  cout << "\n Enter the time in whole years for the deposit: ";
  cin >>iDuration;

  if (iAmount <= 5000)
  // This is the branch for deposits $5000 or less.
  {
    if (iDuration >= 1 && iDuration <= 3)
      cout << "\n Your interest rate: 1.95%" << endl;

    else if (iDuration >= 4 && iDuration <= 6)
      cout << "\n Your interest rate: 2.75%" << endl;

    else if (iDuration >= 7)
      cout << "\n Your interest rate: 3.10%" << endl;
  }

  else if (iAmount > 5000)
  //This is the branch for deposits over $5000.
  {
      if (iDuration >= 1 && iDuration <= 3)
        cout << "\n Your interest rate: 3.45%" << endl;

      else if (iDuration >= 4 && iDuration <= 6)
        cout << "\n Your interest rate: 3.80%" << endl;

      else if (iDuration >= 7)
        cout << "\n Your interest rate: 4.50%" << endl;
  }

  cout << "\n The calculation was completed. Exiting..." << endl;

  return 0;
}

