Question 2 (5 Marks) Small Cylinder/cone Objects Are To Be Delivered To Another Location. These Cubic Objects Will Be Placed Inside A Rectangular Box For Ease Of Management. Assumed The Dimension Of The Cylinder Is 3em For Height And 1.5cm Radius, While T

匿名用户 最后更新于 2021-12-01 19:36 计算机类Computing


Question 2 (5 marks) Small cylinder/cone objects are to be delivered to another location. These cubic objects will be placed inside a rectangular box for ease of management. Assumed the dimension of the cylinder is 3em for height and 1.5cm radius, while the rectangular box (length, width, depth) is 15x18x20 cm. Given is a template (Figure 3) of a C program that determine: 1) the number of cylinder that can be placed inside the rectangular box. ii) the unfilled remaining space in the rectangular box The program should prompt user to enter dimension of cylinder, then dimension of rectangle. The program must display the number of cylinders in the box and the remaining space Complete the Diagram in Figure 3 with the appropriate statements a) Define all variables needed to store the dimension of both shapes (cylinder and rectangular) b) Prompt user to enter dimensions and read data c) Process to calculate the number of cylinders that can be placed in the box d) Process to calculate the remaining space unfilled by the cylinders Display the result 1/ Program to calculate space 44111ng for rectangular box #include int main(void) // a) Variables declaration // b) Prompt user to enter data // c) d) Process Il e) Display the output return 0; Figure 3

已邀请: