以下是我的完整代碼。我試圖包括住院病人,如果案件是一(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