Issue with the for loop. I cant tell what the error is ?!

So I am trying to make a table that shows the car loans interest. However, I get confused that I do not know how to do it properly. Following is the prompt:
Car loans are normally one, two, three, four, five, or six years in length. Given this information, your program will create a table (that is nicely formatted!) that will display the monthly payment for each duration of the loan and interest rate.


the very top row: ( 4) is the lowest rate, and (7) is the highest rate I would like to pay.
Example:

4 5 6 7

______________________

12| xxx

24| xxx

36|

48|

60|

72|I
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
  #include <iostream>
#include <iomanip>
#include <cmath>

using namespace std;

int main()
{
	long int loan; 
	int high,low, step,month;
	double rate,money;
	

	do{
		cout<<" enter your total value of the loan"<<endl;
		cin>>loan;
		cout<<" enter the lowest rate you wanna pay"<<endl;
		cin>>low;
		cout<<" enter the highest rate you wanna pay"<<endl;
		cin>>high;
		cout<<" enter the step size you want"<<endl;
		cin>>step;
		for(int i=low;i<=high;i+=step)
        cout<<setw(9)<<i;
    cout<<endl<<setw(80)<<setfill('-')<<"-"
       <<endl<<setfill(' ');
		
		for(int i =1;i<=6;i++)	//year
		{
			{
			
			month=12*i;
			cout<<setw(3)<<month<<setw(2)<<"|";
			}
			
			
		for (int x=low,x<=high,x+=step)
		
			{
				rate=x/100;
				money=rate*loan;
				cout<<setw(9)<<money;
				
			}
			 cout<<endl;
    	}

    cout<<endl<<"Do you want to do this again? ";
    cin>>ans;
    }while(ans=='Y' || ans == 'y');
    return 0;
}
So I made a attempted on this assignment and I know there is something wrong but I am not able to find out what's wrong with it. Thanks for helping. THANKS!
Last edited on
Topic archived. No new replies allowed.