May 10, 2011 at 5:09pm UTC
hey im making a program to output a bill based off what a user enters but for some reason when i enter something for one cin statement it skips the next cin input and goes directly to the next one below is my code......also the header files PT Demo PTIns and PTBill are custom header files that i made myself and inorder to get by the medical record loop you got to enter 9 9's like 999999999......if anyone can help me that would be great
#include <iostream.h>
#include "PTIns.h"
#include "PTDemo.h"
#include "PTBill.h"
#include "tstring.h"
#include "iomanip.h"
// free function for banner
void banner();
// free function for Health Insurance Codes
void hICodes();
int main( )
{
String patientMedicalRecordNo; // patients medical record number
char healthInsuranceCode; // patient's health insurance code
String policyNo; // patient's policy number
String groupNo; // patient's group number
String patientFirstName; // patient's first name
char patientMiddleInitial; // patient's middle initial
String patientLastName; // patient's last name
String patientStreetAddress1; // patient's address part 1
String patientStreetAddress2; // patient's address part 2
String patientCity; // patient's city
String patientState; // patient's state
String patientZip5; // patient's 5 digit zip code
String patientZip4; // patient's 4 digit zip code
String patientHomeAreaCode; // patients home area code
String patientHomePhoneNo; // patient's home phone number
char patientGender; // patient's gender
int patientDateOfBirth; // patient's date of birth
String patientDiagnosisCode; // patient diagnosis code
bool patientMonthlyPaymentStatus; // patient monthly payment status
double patientMonthlyPaymentAmt; // patient monthly payment amount
double patientCharge; // charge to patient's account
PatientInsuranceInformation yanovich(patientMedicalRecordNo, healthInsuranceCode, policyNo, groupNo);
PatientBillingInformation yanovich1(patientMedicalRecordNo, patientDiagnosisCode, patientMonthlyPaymentStatus
,patientMonthlyPaymentAmt,patientCharge);
PatientDemographicInformation yanovich2(patientMedicalRecordNo, patientFirstName , patientMiddleInitial,
patientLastName, patientStreetAddress1,patientStreetAddress2, patientCity,
patientState, patientZip5, patientZip4, patientHomeAreaCode, patientHomePhoneNo,
patientGender, patientDateOfBirth);
cout << "Enter the patient's medical record number: ";
cin >> patientMedicalRecordNo;
while(patientMedicalRecordNo != "999999999")
{
cout << "No Record Found" << endl << endl;
cout << "Enter the patient's medical record number: ";
cin >> patientMedicalRecordNo;
cout << endl;
}
cout << "Enter the patient's first name: ";
cin >> patientFirstName;
cout << "Enter the patient's middle initial: ";
cin >> patientMiddleInitial;
cout << "Enter the patient's last name: ";
cin >> patientLastName;
cout << "Enter the patient's street address (line 1): ";
getline(cin, patientStreetAddress1);
cout << "Enter the patient's street address (line 2): ";
getline(cin, patientStreetAddress2);
cout << "Enter the patient's city: ";
getline(cin, patientCity);
cout << "Enter the patient's state: ";
getline(cin, patientState);
cout << "Enter the patient's five digit zip code: ";
getline(cin, patientZip5);
cout << "Enter the patient's four digit zip code: ";
getline(cin, patientZip4);
cout << "Enter the patient's home area code: ";
getline(cin, patientHomeAreaCode);
cout << "Enter the patient's home phone number: ";
getline(cin, patientHomePhoneNo);
cout << "Enter the patient's gender (M = Male, F = Female): ";
cin >> patientGender;
cout << "Enter the patient's date of birth (format MMDDYYYY): ";
cin >> patientDateOfBirth;
hICodes();
cout << endl;
cout << "Enter the patient's health insurance code: ";
cin >> healthInsuranceCode;
cout << "Enter the patient's policy number: ";
cin >> policyNo;
cout << "Enter the patient's group number: ";
cin >> groupNo;
cout << "Enter the patient's diagnosis code: ";
cin >> patientDiagnosisCode;
cout << "Enter the patient's monthly payment status (Y = Monthly Plan, N = No Monthly Plan): ";
do
{
cout << "Enter monthly payment amount: ";
cin >> patientMonthlyPaymentAmt;
}
while (patientMonthlyPaymentStatus == true);
banner();
cout << endl << endl;
yanovich2.printPatientDemographicInformation( );
cout << endl << endl ;
yanovich.printPatientInsuranceInformation( );
cout << endl << endl;
yanovich1.printPatientBillingInformation( );
return 0;
}
// free function for banner
void banner()
{
cout << endl << "**************************************************************************" << endl
<< "**************************************************************************" << endl
<< "* *" << endl
<< "* YANOVICH'S MEDICAL CENTER *" << endl
<< "* Building #7, Room #701F *" << endl
<< "* 1333 South Prospect Street *" << endl
<< "* Nanticoke, PA 18634-3899 *" << endl
<< "* (570)740-0586 *" << endl
<< "* *" << endl
<< "**************************************************************************" << endl
<< "**************************************************************************" << endl
<< endl;
}
// free function for Health Insurance Codes
void hICodes()
{
cout << "Health Insurance Codes:" << endl
<< " 1 - Blue Cross" << endl
<< " 2 - Medicare" << endl
<< " 3 - Medical Assistance" << endl
<< " 4 - Other " << endl;