A room needs to be painted that has four walls. The room is rectangular in shape. All four walls are the same height. Two of the walls on the opposite side of each other have the same length. The other two walls on the opposite side of each other have the same width. Paint is purchased based on the amount of square footage that needs to be painted. Assume the room has a standard flat ceiling (no angles nor cathedral ceiling). Input the height, length, and width measurements in feet. Calculate and output each of the following: The square feet of walls need to be painted The square feet of ceiling needs to be painted After calculating the walls square footage and the ceiling square footage, determine which of the two square footages is larger and display which of the two is the larger square footage with an appropriate message stating which one is the larger square footage. (use a sequential structure and a decision structure)
Control structures
Control structures are block of statements that analyze the value of variables and determine the flow of execution based on those values. When a program is running, the CPU executes the code line by line. After sometime, the program reaches the point where it has to make a decision on whether it has to go to another part of the code or repeat execution of certain part of the code. These results affect the flow of the program's code and these are called control structures.
Switch Statement
The switch statement is a key feature that is used by the programmers a lot in the world of programming and coding, as well as in information technology in general. The switch statement is a selection control mechanism that allows the variable value to change the order of the individual statements in the software execution via search.
A room needs to be painted that has four walls. The room is rectangular in shape. All four walls are the same height. Two of the walls on the opposite side of each other have the same length. The other two walls on the opposite side of each other have the same width. Paint is purchased based on the amount of square footage that needs to be painted. Assume the room has a standard flat ceiling (no angles nor cathedral ceiling). Input the height, length, and width measurements in feet. Calculate and output each of the following:
- The square feet of walls need to be painted
- The square feet of ceiling needs to be painted
After calculating the walls square footage and the ceiling square footage, determine which of the two square footages is larger and display which of the two is the larger square footage with an appropriate message stating which one is the larger square footage.
(use a sequential structure and a decision structure)
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 3 images