A local painting company calculates the cost of painting rooms based on the size ofthe room. Each square meter of wall space requires a specific amount of paint andlabor, which has a set cost. The company often deals with orders for multiple roomsof different sizes but wants to understand the calculation of total costs to providequick estimates to customers.You are developing a program to help the painting company calculate the total costof painting multiple rooms in a house. You should write a function in pseudocode thataccepts three input parameters: (a) the number of square meters of the room and (b)the number of rooms to paint. The company charges $1.50 per square meter forlabor and paint. The function should return the total cost for painting the rooms.i. Write the function here…………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………[3]ii. Use the function defined in part (i) to get the total cost for painting 8 rooms of30 square meters per room. Print the result.……………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………[2]
Question
A local painting company calculates the cost of painting rooms based on the size ofthe room. Each square meter of wall space requires a specific amount of paint andlabor, which has a set cost. The company often deals with orders for multiple roomsof different sizes but wants to understand the calculation of total costs to providequick estimates to customers.You are developing a program to help the painting company calculate the total costof painting multiple rooms in a house. You should write a function in pseudocode thataccepts three input parameters: (a) the number of square meters of the room and (b)the number of rooms to paint. The company charges $1.50 per square meter forlabor and paint. The function should return the total cost for painting the rooms.i. Write the function here…………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………[3]ii. Use the function defined in part (i) to get the total cost for painting 8 rooms of30 square meters per room. Print the result.……………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………[2]
Solution
i. Here is the pseudocode for the function:
FUNCTION CalculatePaintingCost(squareMetersPerRoom, numberOfRooms)
SET costPerSquareMeter = 1.50
SET totalCost = squareMetersPerRoom * numberOfRooms * costPerSquareMeter
RETURN totalCost
END FUNCTION
ii. To calculate the total cost for painting 8 rooms of 30 square meters per room, you would use the function like this:
SET squareMetersPerRoom = 30
SET numberOfRooms = 8
SET totalCost = CalculatePaintingCost(squareMetersPerRoom, numberOfRooms)
PRINT totalCost
This will print the total cost for painting 8 rooms of 30 square meters per room.
Similar Questions
Create a structure named warehouse with details like location, name, total_stock_rooms, occupied_rooms, and price_room. Write a C program to input details for the N warehouse. Write user-defined functions for: Function 1: Reading the details of the warehouse. This function should return the structure to the main() function. Function 2: Find the available rooms in the warehouse. Calculate the total cost for available rooms and display the details. Pass the structure returned from function 1 to function 2. Read the number of warehouses, location, name, total_stock_rooms, occupied_rooms, and price_room. Sample Input 2 Chennai Wheat warehouse 100 80 5000 Mumbai Electronic warehouse 15 10 10000 Sample Output [Wheat warehouse in Chennai: Available rooms-20: Cost 100000] [Electronic warehouse in Mumbai: Available rooms-5: Cost 50000]
Ravi wants to estimate the total utility bill for a household based on the consumption of electricity, water, and gas. Write a program to calculate the total bill using the following criteria:The cost per unit for electricity is 0.12, for water is 0.05, and for gas is 0.08.A discount is applied to the total cost based on the following conditions:If the total cost is 100 or more, a 10% discount is applied.If the total cost is between 50 and 99.99, a 5% discount is applied.No discount is applied if the total cost is less than 50.The program should output the total bill after applying the discount with two decimal places.Input format :The input consists of three double values, representing the number of units consumed for electricity, water, and gas respectively.Output format :The output prints a double value, representing the total bill after applying the discount, formatted to two decimal places.Refer to the sample output for formatting specifications.Code constraints :1.00 ≤ units consumed ≤ 10000.00Sample test cases :Input 1 :1000.0200.0100.0Output 1 :124.20Input 2 :500.030.020.0Output 2 :59.95Input 3 :120.070.045.0Output 3 :21.50
Input FormatRead the length of the roomRead the breadth of the roomRead the cost of laying the sheet per square meterRead the minimum cost value to get a discountRead the discount percentageOutput FormatArea of the roomTotal cost of the workYou are eligible for discount/ You are not eligible for discountDiscount amount on the total costTotal cost to be paidSample Input55352520007Sample OutputArea of the room 1925Total cost of the work 48125You are eligible for discountDiscount amount 3368.75Total cost to be paid 44756.25
Declare a structure named “Furniture” to store details like furniture name, furniture type, cost per unit, length, breadth, height, and color. You must read the details of N Furniture. Pass this structure to a user-defined function that will print the details of furniture for the given furniture type.Sample Input2 (N- number of furniture)Chair (furniture name)P (furniture type . W – wood, P-plastic)500 (cost per unit)100.5( float value for length)56.3( float value for breadth)60.2( float value for heigth)red (color)TableW300060.546.380.4WhiteP (Enter the furniture type to search) Sample OutputChair500100.556.360.2red
Question 3.Example 16Meghan buys 1212 pens for a total cost of $15.60$15.60.a.Define a pronumeral for the cost of one pen.+ Workspace+ Check answerb.Write an equation to describe the problem.
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.