Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Q5) Days in a Month Write a program that asks the user to enter the month (letting the user enter an integer in the range

image text in transcribed
image text in transcribed
Q5) Days in a Month Write a program that asks the user to enter the month (letting the user enter an integer in the range of 1 through 12) and the year. The program should then display the number of days in that month. Use the following criteria to identify leap years 1. Determine whether the year is divisible by 100. If it is, then it is a leap year if and only if it is divisible by 400. For example, 2000 is a leap year but 2100 is not. 2. If the year is not divisible by 100, then it is a leap 2008 is a leap year but 2009 is not. year if and if only it is divisible by 4. For example, Here is a sample run of the program Enter a month (1-12): 2 Ente Enter a year: 2008 Enterl rl 29 days Q6) Write a C++ program to generate three multiplications with numbers generated randomly (numbers between 2 and 12 inclusive). If the child user answers correctly, s/he'll get an encouragement otherwise the correct answer is displayed. Here is a sample run of the program; with user's input is in red Do you want to multip If the user replies by 'n the program is terminated 4 x 3 14 No Dear: 4 x3 12 4 x 5 20 Run Very No Dear: 3 x9 27 Bye Q4) Body Mass Index Write a program that calculates and displays a person's body mass index (BMI). The BMI is often used to determine whether a person with a sedentary lifestyle is overweight or underweight for his or her height. A person's BMI is calculated with the following formula: BMI-weight height where weight is measured Kg and height is measured in meter. The program should display a message indicating whether the person has optimal weight, is underweight, or is overweight. A sedentary person's weight is considered to be optimal if his or her BMI is between 18.5 and 25. If the BMI is less than 18.5, the person is considered to be underweight. If the BMI value is greater than 25, the person is considered to be overweight

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

How To Build A Million Dollar Database

Authors: Michelle Bergquist

1st Edition

0615246842, 978-0615246840

More Books

Students also viewed these Databases questions