Question: Make a Height struct with two variable properties, heightInInches and heightInCentimeters. Both should be of type Double. Create two custom initializers. One initializer will take
Make a Height struct with two variable properties, heightInInches and heightInCentimeters. Both should be of type Double.
Create two custom initializers. One initializer will take a Double argument that represents height in inches. The other initializer will take a Double argument that represents height in centimeters. Each initializer should take the passed in value and use it to set the property that corresponds to the unit of measurement passed in It should then set the other property by calculating the right value from the passed in value. Hint: inch centimeters.
If you use the initializer for inches to pass in a height of the initializer should set heightInInches to and heightInCentimeters to
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
