Loop math problem

Here is my code so far, i need to get the dates to go to the first of every month for 30 months and for the Amount Paid/Total Paid to keep adding up until the desired amount entered in by the user and for the Outstanding Balance to decrease to 0 after starting from what ever the user enters.
#include <iostream>
#include <string>
#include <iomanip>
#include <cstdlib>
#define JHoney Joshua Honeycutt
using namespace std;
int PAN;
int DOC;
int TF;
int IP;
int B;
int X;
int Y;
int Z;
int TP;
int OB;
int Day;
int Month;
int Year;
int PAY;
string strMonth[12]= {"January" , "February" , "March" , "April" , "May" , "June" , "July" , "August" , "September" , "October" , "November" , "December" };
int intMonthLeap[12]= {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int intMonthNotLeap[12]= {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
bool valid_date = false;

int main ()

{cout << "Dr. Thad Zalfolkz\n";
cout << "Fee Charges\n";
cout << "\nEnter Your 4 Digit Patient Account Number: ";
cin >> PAN;
cout << "\nEnter Date of Consultation in format DD MM YYYY: ";
cin >> Month >> Day >> Year;
while (Day < 1 || Day > 31 || Month < 1 || Month > 12)
{
cout << "Please Enter a Valid Date: ";
cin >> Month >> Day >> Year;
}
cout << "\nTreatment Fee: ";
cin >> TF;
while (TF<0)
{
cout << "Please Eanter Valid Number: ";
cin >> TF;
}
cout << "Initial Payment: ";
cin >> IP;
cout << "\nBalance Due: " <<(B=TF-IP);
system("CLS");
cout << "\nPayment Due Payment Total Outstanding\n";
cout << "Number Date Amount Paid Balance\n";
X==1;

TF-TP==PAY;
while (X<30)
{
cout << "\n "<< (X) <<" " << Month << " " << Day << " " << Year << " " << (TF/6) << " " << (TP=IP+Z) << " " << (OB=TF-PAY) ;
++X;

}
return 0;
}
please, please put your code into code-tags D':
No idea what that means.. lmao
Put [code] and [/code] around your code.
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
53
54
55
56
57
58
59
60
61
62
#include <iostream>
#include <string>
#include <iomanip>
#include <cstdlib>
#define JHoney Joshua Honeycutt
using namespace std;
int PAN;
int DOC;
int TF;
int IP;
int B;
int X;
int Y;
int Z;
int TP;
int OB;
int Day;
int Month;
int Year;
int PAY;
string strMonth[12]= {"January" , "February" , "March" , "April" , "May" , "June" , "July" , "August" , "September" , "October" , "November" , "December" };
int intMonthLeap[12]= {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int intMonthNotLeap[12]= {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
bool valid_date = false;

int main ()

{cout << "Dr. Thad Zalfolkz\n";
cout << "Fee Charges\n";
cout << "\nEnter Your 4 Digit Patient Account Number: ";
cin >> PAN;
cout << "\nEnter Date of Consultation in format DD MM YYYY: ";
cin >> Month >> Day >> Year;
while (Day < 1 || Day > 31 || Month < 1 || Month > 12)
{
cout << "Please Enter a Valid Date: ";
cin >> Month >> Day >> Year;
}
cout << "\nTreatment Fee: ";
cin >> TF;
while (TF<0)
{
cout << "Please Eanter Valid Number: ";
cin >> TF;
}
cout << "Initial Payment: ";
cin >> IP;
cout << "\nBalance Due: " <<(B=TF-IP);
system("CLS");
cout << "\nPayment Due Payment Total Outstanding\n";
cout << "Number Date Amount Paid Balance\n";
X==1;

TF-TP==PAY;
while (X<30)
{
cout << "\n "<< (X) <<" " << Month << " " << Day << " " << Year << " " << (TF/6) << " " << (TP=IP+Z) << " " << (OB=TF-PAY) ;
++X;

}
return 0;
} 
Topic archived. No new replies allowed.