Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help creating this program and have it done by tomorrow please help thank you. I would like to have the bonus aspect too.

I need help creating this program and have it done by tomorrow please help thank you. I would like to have the bonus aspect too. Thank you.image text in transcribed

image text in transcribed

The txt. file is

Jack Black

M

72

Joe Brown

M

70

Tom Jones

M

74

Janet Smith

F

66

Barbara Herman

F

62

Mandatory Instructions Write a C+program to be used by a personal trainer at a health club to caleulate a person' ideal weight based on the person's gender and height. Create the program in your bgunix class account using the file name lab4.cpp. Include your name, class and class time in a comment at the beginning of the file. 1. Define a structure called Client to store a person's name, gender (M or F) and height (in inches). Chose appropriate data types for structure members. 2. In the main function define a Client pointer variable and dynamically (using the new operator) assign the pointer an address of dynamically allocated Client. The pointer variable should be used for all processing of the Client data. 3. Pass the pointer to a function that prompts the user to enter a name, gender, and height (in inches) for a client, using the pointer, store the data in the structure via pointer parameter. Compile, debug and nun your program to make sure the function is working before going on to the next step. Use e(cin, variableName); to read in the client's name as it i may contain s paces. 4. Pass the pointer to another function to display the client's name, gender, height, ideal weight and weight range. Use the formulas below to calculate the ideal weight (based on the Hamwi formula for a medium frame) and recommended weight range. Male: Female Ideal body weight 106 pounds for first 5 feet6 pounds for each inch over 5 feet. Ideal body weight = 100 pounds for first 5 feet + 5 pounds for each inch over 5 feet. Recommended weight range (both male and female): ideal body weight plus or minus 15 pounds Calculate expected results by hand and record them in the spaces below for the sample data: Jack Black, a male who is 70 inches tall (5' 10"): Jack Black 70" note double quotes s should be displayed to indicate inches! Name Height Ideal weight Weight range Try other heights for males and females to test your program to make sure it is working correctly

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

Larry Ellison Database Genius Of Oracle

Authors: Craig Peters

1st Edition

0766019748, 978-0766019744

More Books

Students also viewed these Databases questions