Presentation is loading. Please wait.

Presentation is loading. Please wait.

HW5(50pts) The homework Due on April 14, 23:59:59

Similar presentations


Presentation on theme: "HW5(50pts) The homework Due on April 14, 23:59:59"— Presentation transcript:

1 HW5(50pts) The homework Due on April 14, 23:59:59
Part 1(20pts). Design class Please create a new class named BMICalculator, the class diagram should look something like below. Please implement the five methods in the class you created for the class diagram.

2 BMICalculator(string) is a constructor, the string you need to input “male” or “female” to the constructor. Please set the default BMI as 24 for male and 22 for female according Wikipedia. BMICalculator(string, double, double) is another constructor, where the string parameter should be male or female, the first double parameter is for the weight and the second is for the height. getBMI() is to return BMI you calculate. getWeight(double height) is to return the suitable weight you calculate, where the input parameter height is in “centimeter” getHeight(double weight) is to return the suitable height you calculate, where the input parameter weight is in “kilogram”

3 Part 2(10pts). Unit testing
For each method, you need to write 1 unit tests. Besides that, you need to write one exception unit test for the two constructors. (It means that, totally you have to write 5 unit tests. ) Hint: the string thrown in your constructor must be “unknown sex according to Wikipedia on BMI”

4 Part 3.(20pts) TA testing We have written 8 unit tests to test the five methods of BMICalculator.h you write. The test cases will not be announced. You have to make all of them pass. You know this by checking Reports on Jenkins.


Download ppt "HW5(50pts) The homework Due on April 14, 23:59:59"

Similar presentations


Ads by Google