You are using a version without Ads of this website. Please, consider donating:

### 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;
}
 ``1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162`` ``````#include #include #include #include #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; } ``````