Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Conversation opened. 1 unread message. Skip t o content Using Gmail with screen readers You could lose access t o your 1 1 years o

Conversation opened. 1 unread message.
Skip to content
Using Gmail with screen readers
You could lose access to your 11 years of Gmail history
Adding a recovery phone and email can help you sign in and keep your account secure
Add recovery infoDismiss
Conversations
11.2GBof15GB(74%) used
Terms * Privacy * Program Policies
Last account activity: 2 minutes ago
Details
#include
#include
using namespace std;
class PaintJob {
public:
??Add your methods here
unsigned short int NumCans;
float CoatCost;
float PaintNeeded;
private:
float Height, Width, Length, Area;
float Budget;
float CanPrice;
};
int main()
{
unsigned short int iBudget =0;??Canbe short int or float
printf("Enter your budget: ");
scanfs("%hu", &iBudget);??if float, then need to use %f
float iHeight =0.0f, iWidth =0.0f, iLength =0.0f, cArea =0.0f, cPaintNeeded =0.0f;
unsigned short int cNumCans =0, cPaintCost =0;
printf("Enter wall hegith (feet): ");
scanfs("%f", &iHeight);
printf("Enter wall width (feet): ");
scanfs("%f", &iWidth);
printf("Enter wall length (feet): ");
scanfs("%f", &iLength);
printf("
******************************
");
??Wall area =2*((HxW)+(HxL))
cArea =2.0f*((iHeight* iWidth)+(iHeight* iLength));
printf("Wall area: %.2fft2
", cArea);
??a Liter of paint covers 100 square feet
cPaintNeeded = cArea ??100.0f;
printf("Amountof paint needed: %.2fL
", cPaintNeeded);
??number of3.7 Liter cans needed to paint the wall
cNumCans = ceil(cPaintNeeded??3.7f);
printf("Numberof paint cans needed: %hu cans
", cNumCans);
??a3.7L can costs 35$
cPaintCost = cNumCans *35;
printf("Paintcost: %hu $
", cPaintCost);
printf("
******************************
");
??thecost for 1,2 and 3 coats of paint, and how far isit from the budget
printf("The price of1 coat(s)of paint: %hi $
",(iBudget- cPaintCost));
??a Liter of paint covers 100 square feet
cPaintNeeded =(cArea*2)??100.0f;
??number of3.7 Liter cans needed to paint the wall
cNumCans = ceil(cPaintNeeded??3.7f);
??a3.7L can costs 35$
cPaintCost = cNumCans *35;
printf("The price of2 coat(s)of paint: %hi $
",(iBudget-(2* cPaintCost)));
??a Liter of paint covers 100 square feet
cPaintNeeded =(cArea*3)??100.0f;
??number of3.7 Liter cans needed to paint the wall
cNumCans = ceil(cPaintNeeded??3.7f);
??a3.7L can costs 35$
cPaintCost = cNumCans *35;
printf("The price of3 coat(s)of paint: %hi $
",(iBudget-(3* cPaintCost)));
return 0;
}
BIT2400start.cpp
Displaying BIT2400start.cpp.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions