### Basic flow control

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;

double CLOSED1 = 0.O53;
double CLOSED2 = 0.050;
double CLOSED3= 0.0575;

cout << " Please enter the time duration in years:";
string time_duration;
cin >> time_duration;

cout << " Please enter o for open, c for closed:";
string mortgage_type;
cin >> mortgage_type;

if (mortgage_type == "o")
{
if (time_duration == 0.5)
{
cout << " The mortgage rate for open in 0.5 year is:" << OPEN1 << endl;
}

else if (time_duration == 1)
{
cout << " The mortagage rate for open in 1 year is:" << Open2 << endl;
}

else if (time_duartion == 5)
{
cout << " The mortagage rate for open in 5 years is:" << OPEN3 << endl;
}

else
{
cout << "Not Apllicable.";
}
}

else

{
if (time_duaration == 0.5)
{
cout << " The mortgage rate for closed in 0.5 year is:" << CLOSED1 << endl;
}

else if (time _duration == 1)
{
cout << " The mortgage rate for closed in 1 year is:" << CLOSED2 << endl;
}

else if (time_duration == 5)
{
cout << "The mortgage rate for closed in 5 years is:" << CLOSED3<< endl;
}
else
{
cout << "Not applicable.";
}
}

return 0;
}

****HI Please help I'm not sure what are the errors because it won't debug or start the program****
Remove the semicolon after `int main()`
Hi L B THANK FOR YOUR HELP
Topic archived. No new replies allowed.