Question
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started