Hey everyone,
I am new to the site and need a little help in my homework assignment. This thing is giving me fits and need to have a payment calculator for a doctors office.
The format according to the teacher is like this:
PATIENT ACCOUNT NUMBER: 1234
CONSULTATION DATE: 12/20/2010
TREATMENT FEE: $2500.00
INITIAL PAYMENT: 300.00
BALANCE DUE: 2200.00
PAYMENT DUE PAYMENT TOTAL OUTSTANDING
NUMBER DATE AMOUNT PAID BALANCE
1 01/01/10 75.00 375.00 2125.00
2 02/01/10 75.00 450.00 2050.00
..........
29 .... 75.00 2475.00 25.00
30 .... 25.00 2500.00 0.00
********** PAYMENT SCHEDULE PRINTED BY: STUDENT NAME ********************
here is the code so far
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 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
|
//Jason Krizman
//cop2000
//assignment 3
#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <string>
#define NAME Jason Krizman
using namespace std;
int main ()
{
int ACCU; // Patient account number
int CONSM; // Consultation date month
int CONSD; // Consultation date day
int CONSY; // Consultation date year
char SLASH; // Unsed / in date
float FEE; // Treatment fee
float INIT; // Initial payment
float TOTAL; // Total balance due
int C; // Counter
int NPAY; // Numbered payments
int DPAY; // Payment due dates
float TPAY; // Total amount payed
float BAL; // Outstanding balance
system ("cls"); // Clear the screen
/* Data Input Section */
cout << "PATIENT ACCOUNT NUMBER: ";
cin >> ACCU;
if (ACCU <= 1000 || ACCU >= 9999)
{
cout << "Please enter a correct account value.";
}
else
{
cout << "CONSULTATION DATE: ";
}
cin >> CONSM;
cin >> SLASH;
cin >> CONSD;
cin >> SLASH;
cin >> CONSY;
if (CONSM < 1 || CONSM > 12) cout << "Please enter a valid date.";
else if (CONSD < 1 || CONSD > 31) cout << "Please enter a valid date.";
cout << "TREATMENT FEE: $ ";
cin >> FEE;
cout << "INITIAL PAYMENT: $ ";
cin >> INIT;
BAL = FEE - INIT;
cout << "BALANCE DUE: $ " << BAL;
cout << " " << endl;
cout << setw(10) << "PAYMENT" <<setw(10) << "DUE" << setw(10) << "PAYMENT" << setw(10) << "TOTAL" << setw(13) << "OUTSTANDING" << endl;
cout << setw(10) << "NUMBER" <<setw(10) << "DATE" << setw(10) << "AMOUNT" << setw(10) << "PAID" << setw(10) << "BALANCE" << endl;
int a = 1;
C = 75;
for (float i = BAL; i >= 0; i = i - C)
TPAY = C + INIT;
{
cin >> C; cout << setw(10) << a++ ; cout <<setw(10) << CONSD << SLASH << CONSM << SLASH << CONSY << setw(10) << C << setw(10) << TPAY << setw(10) << BAL << endl;
}
system ("PAUSE");
return 0;
}
|
any help or will be greatly appreciated