COS 100: Introduction to Programming

Fall 2019

HW Project 02: Counting the cost

Due: 09/25 Wed 10pm

For which of you, intending to build a tower, does not sit down first and count the cost, whether he has enough to finish it—lest, after he has laid the foundation, and is not able to finish, all who see it begin to mock him, saying, ‘This man began to build and was not able to finish’?
Luke 14:28–30

Project goal

You have been tasked with building a cylindrical grain silo. The main section of the silo is a cylinder, and the top is a hemisphere (half of a sphere).

Project specification

  1. Name your project source code silo.py.
  2. Prompt the user to provide a diameter for the base of the silo in meters.
  3. Prompt the user for the height of the cylinder part of the silo in meters.
  4. Assume that the dome part is a hemisphere with a radius equal to that of the base of the silo.
  5. Tell the user what the footprint area covered by such a silo would be.
  6. Tell the user what the total volume inside the silo would be.
  7. Tell the user how much paint coverage would be needed to cover the entire outside of the silo (not including the bottom since that's in contact with the ground).
  8. Use proper units for each statement to the user.
  9. Include your name in the comments at the top of your source code. (Mimic the format from the previous homework.)

Sample run

Please provide the diameter of the silo in meters: 23.7
Please provide the height of the silo in meters: 117.2
With a diameter of 23.7 meters, and a height of 117.2 meters, 
the silo will cover a footprint area of
441.1502943987127 square meters, a volume of 55187.901829278955 cubic meters, and require
9608.514007114578 square meters of paint.

Suggested order of development

It is best to develop programs incrementally, testing small bits and pieces as you go. Here is a suggested order of development based on years of experience.
  1. Prompt the user and collect input values.
  2. Print out the part of the report that just repeats the user's inputs back to them.
  3. One at a time, calculate and add to the report:
    • The footprint area
    • The volume
    • The surface area that needs to be painted

Notes and hints

Start early, have fun, and discuss questions on Moodle.