I keep getting an error when I try to run this program. What are the proper step
ID: 3653763 • Letter: I
Question
I keep getting an error when I try to run this program. What are the proper steps I need to take?
#include using namespace std; float insum(int d,float r,float chs,float hmc); float outsum(float chs,float hmc); int main() { int a; cout<<"Enter [1] for in-patient and [2] for out-patient: "; cin>>a; switch(a) { case 1: { cout<<"Enter number of days spent in the hospital: "; int d; cin>>d; cout<<"Enter daily rate: "; float r; cin>>r; cout<<"Enter charges for hospital services: "; float chs; cin>>chs; cout<<"Enter hospital medication charges : "; float hmc; cin>>hmc; float tc=insum(d,r,chs,hmc); cout<<"Total Charges are: "<<tc; break; } case 2: { cout<<"Enter charges for hospital services: "; float chs; cin>>chs; cout<<"Enter hospital medication charges : "; float hmc; cin>>hmc; float tc=outsum(chs,hmc); cout<<"Total Charges are: "<<tc; } } } float insum(int d,float r,float chs,float hmc) { return ((((float)d)*r)+chs+hmc); } float outsum(float chs,float hmc) { return (chs+hmc); }
This is the format I am suppose to use. Please help me...
Write a program that computes and displays the charges for a patient