#include <iostream> #include <string> #include <iomanip> #include \"billType.h\"
ID: 3725821 • Letter: #
Question
#include <iostream>
#include <string>
#include <iomanip>
#include "billType.h"
using namespace std;
void billType::printBill() const
{
cout << fixed << showpoint;
cout << "Pharmacy Charges: $" << pharmacyCharges << endl;
cout << "Room Charges: $" << roomRent << endl;
cout << "Doctor's Fees: $" << doctorFee << endl;
cout << "______________________________ " << endl;
cout << "Total Charges: $" << pharmacyCharges - roomRent + doctorFee << endl;
}
double billType::billingAmount()
{
return pharmacyCharges + roomRent + doctorFee;
}
void billType::setInfo(string id, double phCharges, double rRent,
double docFee)
{
ID = id;
pharmacyCharges = phCharges;
roomRent = rRent;
doctorFee = docFee;
}
void billType::setID(string id)
{
ID = id;
}
string billType::getID()
{
return ID;
}
void billType::setPharmacyCharges(double charges)
{
pharmacyCharges = charges;
}
double billType::getPharmacyCharges()
{
return pharmacyCharges;
}
void billType::updatePharmacyCharges(double charges)
{
pharmacyCharges = pharmacyCharges + charges;
}
void billType::setRoomRent (double charges)
{
roomRent = charges;
}
double billType::getRoomRent()
{
return roomRent;
}
void billType::updateRoomRent(double charges)
{
roomRent = roomRent + charges;
}
void billType::setDoctorFee(double charges)
{
doctorFee = charges;
}
double billType::getDoctorFee()
{
return doctorFee;
}
void billType::updateDoctorFee(double charges)
{
doctorFee = doctorFee + charges;
}
billType::billType(string id, double phCharges, double rRent,
double docFee)
{
ID = id;
pharmacyCharges = phCharges;
roomRent = rRent;
doctorFee = docFee;
}
Error: no 'void billType::setRoomRent(double)' member function declared in class 'billType'
Explanation / Answer
The exact problem has not been specified. Assuming that the problem is the error message:
Error : [Error] no 'void billType::setRoomRent(double)' member function declared in class 'billType'
The problem lies in the header file billType.h that is not provided. In the declaration of class billType, the prototype for this function is missing. The following line must be missing in the header file:
class billType
{
......
void billType::setRoomRent(double);
......
};
Adding the prototype in the class declaration should fix the compilation issue.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.