How to do correct month order
This is my assignment
100.PNG - Google Drive
Capture 200.PNG - Google Drive
how I create months in right order
this is my code :
Code:
#include <iostream>
using namespace std;
int main ()
{
int an1,bb1,tm,i,mn1;
double in1;
double q1;
double qq1;
double qqq1;
double q2;
double q3;
double ad=0;
double aw=0;
int f1=1;
int f2;
int fo=1;
int yn=1;
int mn=1;
double z;
int ynl=1;
//account 01
cout << "Enter your account number : ";
cin >> an1;
while(an1<1000 || an1>9999)
{
cout << "Enter your account number : ";
cin >> an1;
}
cout << "Enter your account beginning balance: ";
cin >> bb1;
while(bb1<0 || bb1>100000)
{
cout << "Enter your account beginning balance: ";
cin >> bb1;
}
cout << "Enter your account interest rate: ";
cin >> in1;
while(in1<0 || in1>0.15)
{
cout << "Enter your account interest rate: ";
cin >> in1;
}
// term the account
cout << "Enter a term the accounts will be held: ";
cin >> tm;
while(tm<0 || tm>10)
{
cout << "Enter a term the accounts will be held: ";
cin >> tm;
}
cout << "Enter an automatic deposit amount per month: ";
cin >> ad;
cout << "Enter an automatic withdrawal amount per month : ";
cin >> aw;
q1=in1/12;
f2=tm*12;
q2=bb1;
for (i=1;i<=f2;++i)
{cout << "Year number : " << ynl << "\n";
cout << "Month number : " << mn << "\n";
cout << "Month-starting balance : " << q2 << "\n";
z=q2+(q1*i)+(ad-aw);
cout << "Month-ending balance : " << z << "\n";
if (i>=0 && i <=11)
{
ynl=1;
}
else if (i>=12 && i <=23)
{
ynl=2;
}
else if (i>=24 && i <=35)
{
ynl=3;
}
else if (i>=36 && i <=47)
{
ynl=4;
}
else if (i>=48 && i <=59)
{
ynl=5;
}
else if (i>=60 && i <=71)
{
ynl=6;
}
else if (i>=72 && i <=83)
{
ynl=7;
}
else if (i>=84 && i <=95)
{
ynl=8;
}
else if (i>=96 && i <=107)
{
ynl=9;
}
else
{
ynl=10;
}
cout << " ------------------------------ " << "\n";
mn=mn+1;
q2=z;
z=z+(q1*i)+(ad-aw);
}
return 0;
}
Please help me !!!!!!!!!!!!!!!!!!!!!!!!!!! :confused: