A lending institution wants to develop a questionnaire to determine what mortgage rate is available based on the type and duration of the mortgage desired.
To this end, users enter their choice for (i) either an open or closed mortgage, and; (ii) the term duration (six months, one year or five years).
Based on the user input, the available mortgage rate is provided based on the following table.
Term Duration Open Closed
0.5 yr 7.10 % 5.30 %
1 yr 7.50 % 5.00 %
5 yr Not Available 5.75 %
The program should output appropriate
messages if the following occur:
a) An invalid term duration is entered (e.g., three years)
b) An invalid type is entered (e.g., “oppen” (spelling), “variable”, “partially open”)
c) The input is correct but the option is unavailable (e.g, 5 yr open mortgage).
//include necessary libraries
# include <iostream>
# include <string>
//use std namespace
using namespace std;
int main ();
{
double OPEN1= 0.071;
double OPEN2= 0.075;
double OPEN3= not available;