Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program that outputs a dentist bill. For members of a dental plan, the b

ID: 3633037 • Letter: W

Question

Write a program that outputs a dentist bill. For members of a dental plan, the bill consists of the service charge (for the particular procedure performed) and test fees, input to the program by the user. To nonmembers the charges consist of the above services plus medicine (also input by the user). The program first asks if the patient is a member of the dental plan. The program uses two overloaded functions to calculate the
total bill. Both are value returning functions that return the total charge.
Sample Run 1:
Please input a one if you are a member of the dental plan
Input any other number if you are not
1
Please input the service charge
7.89
Please input the test charges
89.56
The total bill is $97.45
Sample Run 2:
Please input a one if you are a member of the dental plan
Input any other number if you are not
2
Please input the service charge
75.84
Please input the test charges
49.78
Please input the medicine charges
40.22
The total bill is $165.84

Thanks

Explanation / Answer

please rate - thanks

#include <iostream>
#include <iomanip>
using namespace std;
double getbill(double,double);
double getbill(double,double,double);
int main()
{int member;
double fee,test,meds,total;
cout<<"Please input a one if you are a member of the dental plan ";
cout<<"Input any other number if you are not ";
cin>>member;
cout<<"Please input the service charge ";
cin>>fee;
cout<<"Please input the test charges ";
cin>>test;
if(member==1)
    total=getbill(fee,test);
else
    {cout<<"Please input the medicine charges ";
    cin>>meds;
    total=getbill(fee,test,meds);
    }
cout<<"The total bill is $"<<total<<endl;
system("pause");
return 0;
}
double getbill(double a,double b)
{return a+b;
}
double getbill(double a,double b,double c)
{return a+b+c;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote