Develop a program (hat will compute the total bill of a hospital patient. The us
ID: 3771255 • Letter: D
Question
Develop a program (hat will compute the total bill of a hospital patient. The user inputs arc: Number of days in the hospital Surgery cost Medication cost Miscellaneous cost Cost per day Insurance deductible The program must compute and print the following for insurance purposes. Total cost Total cost less insurance deductible Total Cost less cost of medication and deductible Create a program where the user selects the name of a figure and the program presents the formula that is used for calculating its area. Use rectangle and triangle as the figure choices Develop a program that will solve for the power dissipation of a resistor when the voltage across the resistor and the current in the resistor are known. The relationship for resistor power dissipation is the following equationExplanation / Answer
1.
#include<iostream.h>
#include<conio.h>
void main()
{
int nod, surcost, medicost, miscost, costday, insuded;
double totcost, tot_less_ins, tot_less_medi;
cout<<"enter number of days in hospital";
cin>>nod;
cout<<"Enter sugery cost";
cin>>surcost;
cout<<"enter medication cost";
cin>>medicost;
cout<<"Enter misleneous cost";
cin>>miscost;
cout<<"enter cost per day";
cin>>costday;
cout<<"Enter insuance dedectable";
cin>>insuded;
totcost=((nod*costday)+surcost+medicost+miscost);
cout<<"Total cost"<<totcost;
tot_less_ins=totcost-insuded;
cout<<"Total cost less insurance deductable";
cout<<tot_less_ins;
getch();
}
2.
#include<iostream.h>
#include<conio.h>
void main()
{
char name[20];
double area,h,w,b,l;
cout<<"enter figure name";
cin>>name;
if(strcmp(name,"Rectangle")==0)
{
cout<<"Enter width";
cin>>w;
cout<<"Enter length";
cin>>l;
area=w*l;
cout<<"area is "<<area;
}
else if (strcmp(name,"Triangle")==0)
{
cout<<"Enter height";
cin>>h;
cout<<"Enter base";
cin>>b;
area=h*b/2;
}
getch();
}
3.
#include<iostream.h>
#include<conio.h>
void main()
{
double p,i,e;
cout<<"enter resistance current";
cin>>i;
cout<<"enter resistance voltage";
cin>>e;
p=i*e;
cout<<"P="<<p;
getch();
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.