*Weight is one indicator of good nutrition and physical development of a baby's growth. The below chart shows weights in the 50th percentile of formula-fed babies during the first 3 months. At Birth: 3.5 kg 1 month old: 4.9 kg 2 month old: 5.8 kg 3 month old: 6.8 kg Invalid month otherwise Write an application named BMI that outputs an ideal weight based on the user's input of baby's age(in months). YOU MUST USE ONLY A NESTED IF statement to solve this problem */
*Weight is one indicator of good nutrition and physical development of a baby's growth. The below chart shows weights in the 50th percentile of formula-fed babies during the first 3 months. At Birth: 3.5 kg 1 month old: 4.9 kg 2 month old: 5.8 kg 3 month old: 6.8 kg Invalid month otherwise Write an application named BMI that outputs an ideal weight based on the user's input of baby's age(in months). YOU MUST USE ONLY A NESTED IF statement to solve this problem */
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
Pls help ASAP.

Transcribed Image Text:*Weight is one indicator of good nutrition and physical development of a baby's
growth. The below chart shows weights in the 50th percentile of formula-fed babies
during the first 3 months.
At Birth: 3.5 kg
1 month old: 4.9 kg
2 month old: 5.8 kg
3 month old: 6.8 kg
Invalid month otherwise
Write an application named BMI that outputs an ideal weight based on the user's
input of baby's age(in months).
YOU MUST USE ONLY A NESTED IF statement to solve this problem
*/
Expert Solution

Algorithm
Step 1: Prompt and accept the age of baby in months.
Step 2: Check whether month equals 0. If it is true, then output ideal weight as 3.5 Kg.
Step 3: Check whether month equals 1. If it is true, then output ideal weight as 4.9 Kg.
Step 4: Check whether month equals 2. If it is true, then output ideal weight as 5.8 Kg.
Step 5: Check whether month equals 3. If it is true, then output ideal weight as 6.8 Kg.
Step 6: Otherwise, display "Invalid month".
Step by step
Solved in 4 steps with 3 images

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON

Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education