got a program i gotta do for a class not working right

the program below needs to output information that the user enters but i cant fully correct the problems on it due to the fact that when i run the program and start to enter the information i need it starts to skip the next cin statements for example after i enter in patient last name it outputs enter street address 1 but skips the ability to input anything and goes right to enter street address 2 also does it again later in the program after entering the date of birth it skips the health insurance code input and the policy number input and goes to the group number input. im really new to this stuff but i gotta do it for a class. need help asap.......NOTE IF the display is out of wack its due to me copy and pasting it into the box......also header files were custom made....we had to make the header files for the program but they should be good......any assistance would be great thanks



#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;
}
also in order to get by the medical record number loop you got to enter 9 9's like "999999999"
Topic archived. No new replies allowed.