Question: (1) Window Tinting write C program Assume that you have a company that tints building windows. You have found a good price on nice gold
(1) Window Tinting
write C program Assume that you have a company that tints building windows. You have found a good price on nice gold tinting film that comes in rolls that are 5 feet wide and 92 feet long. You want to write a program that determines the number of rolls that will be needed to be purchased to cover a building completely. Your program should assume that each window is the exact same size in the building and that the windows are always less than or equal to 5 feet wide. The program should ask the user for the number of floors in the building, the number of windows on each floor (includes all sides of the building) and the dimensions of the window (in inches). The program should then calculate the number of rolls needed. Note that when tinting a window, it must be done with one entire piece of film. That is, you CANNOT cut pieces of film to fit on the windows. You should determine whether the 5 foot width of tint roll is able to cover two or more windows. For example, if the windows are 12" x 24", then you can cover five windows with just two feet of roll but if placed sideways, you can only cover 4 windows, with a little waste left over (see picture below). You should choose the best option in this case. However, you must not apply any other packing/fitting algorithm for the purpose of marking consistency. Just choose which direction to put the tint on up and down or left to right. The program should output the correct number of tinting rolls that need to be purchased. Make sure to define appropriate constants in your code, as this represents proper coding style. Also, make sure to test adequately.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
