Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Homework 1 1. Design a C++ program to output your BMI score. Body mass index (BMI) is a very popular index showing your healthy situation.

Homework 1 1. Design a C++ program to output your BMI score.

Body mass index (BMI) is a very popular index showing your healthy situation. The BMI calculation formula is BMI = kg/2(this is m square), where kg is a persons weight in kilograms and 2 is your height in metres squared.

The program you designed should have the following functions:

Instruction to let you input your weight.

Instruction to let you input your height.

The program reads your input and then output your BMI

score on the screen.

(Bonus) The program output You are overweight. if the BMI

score is equal or larger than 25; output You are in the healthy weight. if the BMI score in the range 18.5~25; output You are underweight. if the BMI score is smaller than 18.5.

2. Design a C++ program to convert seconds to a concise representation way: x hours y minutes z seconds. Input an integer that represents a length of time in seconds. The program should then output the number of hours, minutes, and seconds that corresponds to that number of seconds. For example, if the user inputs 50391 total seconds, then the program should output 13 hours, 59 minutes, and 51 seconds. (13*3600+59*60+51 = 50391) Hint: you might consider modulus (%) operator to solve the problem.

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_2

Step: 3

blur-text-image_3

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

XML Data Management Native XML And XML Enabled Database Systems

Authors: Akmal Chaudhri, Awais Rashid, Roberto Zicari, John Fuller

1st Edition

0201844524, 978-0201844528

More Books

Students also viewed these Databases questions

Question

d. Who are important leaders and heroes of the group?

Answered: 1 week ago

Question

How are members held accountable for serving in the assigned roles?

Answered: 1 week ago

Question

Have roles been defined and assigned?

Answered: 1 week ago