Question: Problem: You need to write a code to decide whether or not a desk will fit a room (with its sides parallel to the room)
Problem:
You need to write a code to decide whether or not a desk will fit a room (with its sides parallel to the room) given the dimensions of both.
The function sizeCheck() takes in 4 parameters, two for length and width of the room and two for the length and width of the desk. (All lengths should be considered as integers and the parameter list should match with the sequence mentioned above). Based on the parameter, it returns 1 if the desk fits or returns 0 if the desk does not fit.
In the main function, you should take all the inputs and call the sizeCheck() function. Based on the returned value by the function, print the appropriate message in the main function.
If you think a bit, only knowing the area of the room and desk is not enough to make this decision due to their shapes. For example, see the following sample Input/Output 3, where the area of the room is bigger than the area of the desk, however, that desk will not fit in the room.
Sample Input/Output 1:
Enter the length and width of the room: 10 10
Enter the length and width of the desk: 10 10
The desk will fit in the room
Sample Input/Output 2:
Enter the length and width of the room: 12 14
Enter the length and width of the desk: 14 12
The desk will fit in the room.
Sample Input/Output 3:
Enter the length and width of the room: 21 17
Enter the length and width of the desk: 10 22
The desk will not fit in the room.
Rubric:
2 points
You must have to write the function and use it to get the full credit.
This is in C programming language.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
