Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using C#/C Sharp Exercise 6-4: BMI Calculator A Body mass index (BMI) is a measure of body fat based on height and weight that applies

image text in transcribedUsing C#/C Sharp

Exercise 6-4: BMI Calculator A Body mass index (BMI) is a measure of body fat based on height and weight that applies to adult men and women. The formula universally used is weight (lb) height (in)2 703 x In this project, 1. Create a class named BMI, which contains two private data members: weight and height, and one public data member BMI_measure. Use data type double for all data members. 2. The class shall provide two constructors. a. The default constructor initializes data members weight and height to be '1'. b. An overloaded constructor uses two parameters in_weight and in_height. c. The constructors shall calculate and store the BMI measure by invoking a private member function calculate_BMI(), specified next. 3. calculate_BMI() shall be a private member function, which calculates the BMI using the above formula and stores the result in BMI_measure. 4. Provide a public member function set_values(double, double) which can modify the values for weight and height. This function shall calculate the BMI_measure by invoking the member function calculate_BMIO 5. A public print function shall be provided for outputting the data members, e.g., weight, height, and BMI_measure. 6. The main driver shall create two objects: Bob_BMI and Alice_BMI a. Bob is created using the default constructor and then change the weight and height by invoking the set_values method. b. Alice is created using the overloaded constructor. 7. The main driver shall print out the data for both Bob and Alice. Process Review: 1. Understand the problem 2. Decide classes needed 3. UML Design 4. Think again: How do the modules (classes) solve the problem? What does the driver need to do? Are the members enough? etc. 5. Develop the code for each class 6. Develop the driver

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Managing Your Information How To Design And Create A Textual Database On Your Microcomputer

Authors: Tenopir, Carol, Lundeen, Gerald

1st Edition

1555700233, 9781555700232

More Books

Students also viewed these Databases questions

Question

How does selection differ from recruitment ?

Answered: 1 week ago