fuction not working

after i was able to get my other program to run with everyone's input I decided to try a different one to get a better understanding of function programming. I current objective is to write a program that computes and displays the charges for a patient’s hospital stay.

The program design is:

First, the program should ask if the patient was admitted as an in-patient or an out-patient. If the patient was an in-patient, the following data should be entered:

• The number of days spent in the hospital
• The daily rate
• Hospital medication charges
• Charges for hospital services (lab tests, etc.)

The program should ask for the following data if the patient was an out-patient:

• Charges for hospital services (lab tests, etc.)
• Hospital medication charges The program should use two overloaded functions to calculate the total charges.

One of the functions should accept arguments for the in-patient data, while the other function accepts arguments for out-patient information. Both functions should return the total charges. Input Validation: Do not accept negative numbers for any data.

The issues I am having when I attempt to complie state:

too few arguments to function `double getInPatient(int, double, double, double)'

too few arguments to function `double getOutPatient(double, double)'

it also states varibles that are declared as undeclared.

ambiguates old declaration `double getInPatient(int, double, double, double)'
ambiguates old declaration `double getOutPatient(double, double)'

I do believe if I can get past the too few arguments to function issues the rest might be taken of. Thank you in advance to all who come to my aid.

[code]
// *****************************************************************************
// Program: Overloaded Hospital
// Purpose: program that computes and displays the charges for a patient's
// hospital stay. ask if the patient was admitted as an in-patient or
// an out-patient. If the patient was an in-patient, the following data
// should be entered: The number of days spent in the hospital, The
// daily rate, Hospital medication charges, and Charges for hospital
// services (lab tests, etc.) ask for the following data if the patient
// was an out-patient: Charges for hospital services (lab tests, etc.)
// and Hospital medication charges. Input Validation: Do not accept
// negative numbers for any data.
// *****************************************************************************

# include <iostream>
using namespace std;

double getInPatient(int numberofDays, double dailyRate, double hospitalMedicationCharge, double chargesForHospitalServices);
double getOutPatient(double hospitalMedicationCharge, double chargesForHospitalServices);

int main()
{
char patientStatus;

cout << "Is the patient an In-patient or Out-patient: ";
cin >> patientStatus;

while (patientStatus !='I' || patientStatus !='i'
|| (patientStatus != 'O' || patientStatus != 'o'))
{
cout << "ERROR! Please enter one of the following (I,i O, o): ";
cin >> patientStatus;
}

Instead of using the or operator, use and. Ironically, I can't logically figure out why it works, but the and operator definitely allows the program correctly, I tried it to make sure.
Or says if either of the conditions returns true then return true, and operator says if both conditions are true then return true.
Topic archived. No new replies allowed.