Program General Description:Write a program that receives input in groups of 2 to determine the amount of material to produce various sizes of cans and determine how many cans can be made from an...




Program General Description:





Write a program that receives input in groups of 2 to determine the amount of material to produce various sizes of cans and determine how many cans can be made from an amount of material.





The basic program: 85%



The program will print out the program name and description of what the program will do. The program will then prompt for 3 pairs of data:





  • height of a can, in cm





  • radius of the can, in cm





The program will ask for the dimensions for 3 cans.



After receiving the height and radius for 1 can, the program will print out the surface area of that can in sq cm.





After the last can’s surface area is printed, the program will prompt for an amount of material to make cans (in sq cm).



The program will then determine how many of each type of can can be made from the material.





Technical details:





  • formula for the surface area of a cylinder is to the right







  • follow conventions taught in class





  • has comments





  • will only use material listed in class notes





  • neatness, creativity for the interface/interaction counts





(ie simple to use, minimum typing, clear output)





  • assume the user always enters valid input – do not worry about errors if user enters invalid values





  • any internal calculated values must use all the decimal values as calculated (ie not rounded)





  • any displayed numbers must be rounded to 1 decimal place, where appropriate





  • no decimals for the calculated number of cans





  • use 3.1416 as pi







Example Output (note: this display would not receive full marks):





Enter height (cm) : 8.5



Enter radius (cm) : 5



One can needs : 424.1 sq cm



:



Enter Amount of Material (cm

2

) : 100000



:



For first dimensions: 235 cans can be made



:





Next Additional: 10%



The program will accept any number of cans (ie not limited to 3).



The program will also, for each type of can, calculate





  • the number of crates of whole cans that can be filled into a crate





  • the number of whole cans that could not fit into a crate





One crate can hold 600 cans.





Final Additional : 5%



The program will calculate the

minimum number

of the different types of cans that can fit into one crate using the following algorithm:





  1. assuming there are n types of cans, then one group of cans consists of :





n of the cans with the largest surface area



n – 1 of the cans with the next largest surface are







:



1 of the can with the smallest surface area





  1. determine how many of these

    whole groups

    can fit in a crate





  2. print out the resulting number of cans of each type of can.





Note: You do not need to write your own sort function.








Oct 07, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here