Sorry Hope this helps. If not...
Code:
#include <iostream.h>
#include <stdlib.h>
using namespace std;
void Clear();
int main()
{
int Qp,Tp,T;
cout<<"How Long are you takeing this loan out for?"<<endl //question 1
<<"(in Years. Defalt is 1 and Max is 40)."<<endl;
cin>>T; //user input.
//test question 1 to see if T = 0 thru 40.
if (T<0 || T>40) //if T does not = 0 thru 40
T=1; // Make T = 1
else
{ T=T; }; //else T = T .
Clear(); //function
//question 2
cout<<"How offten are your payments?"<<endl
<<"1) Monthly "<<endl
<<"2) By-weekly"<<endl
<<"3) Weekly "<<endl
<<"4) Yearly "<<endl
<<" Default is once a year (4)"<<endl;
//output all of the above.
cin>>Qp; //Get user input...DOES NOT DO THIS.
//SWITCH - CASE.....GOES TO DEFAULT??????????????
switch(Qp) {
case 1: Tp=T*12;break;
case 2: Tp=T*26;break;
case 3: Tp=T*52;break;
default: Tp=T;break;
};
//OUTPUT DOES THIS.
cout<<"So, You would have a total of "<<Tp<<" Payments!"<<endl;
Clear(); //function
}
void Clear()
{
system("PAUSE");
system("CLS");
};
[code][/code]tagged by Salem