以下是我的完整代码。我试图包括住院病人,如果案件是一(1)但一些突出显示是错误的。有没有无论如何要解决这个问题,如果不是可以请你告诉我另一种方式,只要做到这一点,因为它包括住院,如果一(1)进入如何在超载功能中包含和超载功能
void selection(int &);
void processor(int &);
void inPatient(double &, double &, double &, double &);
int main()
{
int selected, include;
double numberOfDays, dailyRate, chargesForHospital, hospitalMedicationCharge;
selection(selected);
validate(selected, selected);
processor(selected);
system("pause");
return(0);
}
void selection(int & selectedOption)
{
cout << "\nEnter Selection: ";
cin >> selectedOption;
}
void processor(int & selectedOption)
{
switch(selectedOption)
{
case 1:
inPatient(umberOfDays, dailyRate, chargesForHospital, hospitalMedicationCharge);
break;
case 2:
cout << "out-Pat" << endl;
break;
default :
cout << "Nothing Selected" << endl;
break;
}
}
void inPatient(double & numberOfDays, double & dailyRate, double & chargesForHospital, double & hospitalMedicationCharge)
{
cout << "The number of days spent in the hospital: ";
cin >> numberOfDays;
cout << "The daily rate: ";
cin >> dailyRate;
cout << "Charges for hospital services (lab tests, etc.): ";
cin >> chargesForHospital;
cout << "Hospital medication charges: ";
cin >> hospitalMedicationCharge;
}
什么问题? – Caleb 2014-11-20 22:28:24
什么是正确的方式来包括名称帕特里克 – 2014-11-20 22:31:03
这里有太多的错误,发布一些实际编译的代码。 – Aesthete 2014-11-20 22:31:41