Answer to Question #170083 in C for R SWASTHIK

Question #170083

The company XYZ is offering painting services.

The cost for painting each window is 200 Rs.

The cost for painting each door is 500 Rs.

The company charges 33 Rs per square feet.

Additional service charges are 500 Rs per room.

To calculate the square feet of a room that is rectangular or square,

simply multiply the length of the room by the width.

Write a C program to calculate the painting cost of your room.

Requirements:

1. Capture length and width of the room.

2. Capture number of windows in room from user

3. Capture number of doors in room from user

4. Compute area of room in square feet.

5. Display area of room(sqft).

5. Compute painting cost with suitable expression.

6. Display painting cost.


1
Expert's answer
2021-03-09T01:54:03-0500
#include <stdio.h>
int main() {
    int no_win,no_door;
    float len,width,area,cost_room,cost_door,cost_win,cost_total;
    printf("Please provide the dimension of room in foot");
    printf("\nEnter the lenghth of room ");
    scanf("%f",&len);
    printf("\nEnter the width of room ");
    scanf("%f",&width);
    printf("\nEnter the number of windows in the room ");
    scanf("%d",&no_win);
    printf("\nEnter the number of doors in the room ");
    scanf("%d",&no_door);
    area=len*width;
    printf("\nArea of the room to be painted is %f sqft",area);
    cost_room=area*33;
    cost_door=500*no_door;
    cost_win=200*no_win;
    cost_total=cost_room+cost_door+cost_win+500;
    printf("\nPainting cost of room is %f",cost_total);
} 

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS