/volume-of-a-cone-calculator

MSc Computer Science coursework @ Birkbeck, University of London

Primary LanguagePython

ConeVolumeCalculator.py

A Python 3 Math challenge using unit tests. Goal:

Write a python function that calculates the volume of a cone and rounds it to the 2nd digit.

Inputs:

  • calculateConeVolume() receives two inputs (both floats):
    • receives baseRadius as float
    • receives height as float

Outputs:

  • calculateConeVolume() returns 1 output (a float) rounded to the 2nd digit:
    • you will need to use a the round() function

Notes/Challenge Opportunity

  • This challenge does not deal with incorrect input (I'll save that for another challenge)

Examples: inputs => output/s

  • 20.0 10.0 => 4188.79
  • 100.0 10.0 => 104719.76
  • 40.0 108.0 => 180955.74
  • 65.5 80.5 => 361665.51
  • 65 90 => 398196.87
  • 60.0 100.0 => 376991.12
  • 95 80 => 756076.63
  • 100 90 => 942477.80