Question 1 Write a program that reads from the user the height and radius of a cylinder, and then...
Question 1
Write a program that reads from the user the height and radius of a cylinder, and then outputs the area of this cylinder. The area of the cylinder is calculated using the formula:
A=2*π*r*h+2*π*r2, where π = 3.14.
Sample run:
Enter the radius of the cylinder: 8.2
Enter the height of the cylinder: 9
The area of the cylinder is 885.75
Question 2
Write a program that reads the name, weight and height of a patient. Then the program outputs if the patient is under weight, average or over weight based on the following formula:
BMI = weight/height2
BMI < 20: Underweight
BMI between 20 and 25: Average
BMI > 25: Over weight
Sample run 1:
Enter your name: Samar
Enter your weight in kg: 70
Enter your height by meters: 1.67
Samar is overweight
Sample run 2:
Enter your name: Rola
Enter your weight in kg: 48
Enter your height by meters: 1.5
Rola is average
Sample run 3:
Enter your name: Rami
Enter your weight in kg: 85
Enter your height by meters: 1.88
Rami is underweight
Java language

Login to view answer.