
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Object Oriented Programming With Java
Typology: Quizzes
1 / 1
This page cannot be seen from the preview
Don't miss anything!

1.12 (Average speed in kilometers) Assume that a runner runs 24 miles in 1 hour, 40 minutes, and 35 seconds. Write a program that displays the average speed in kilometers per hour. (Note 1 mile is equal to 1.6 kilometers.) 2.14 (Health application: computing BMI) Body Mass Index (BMI) is a measure of health on weight. It can be calculated by taking your weight in kilograms and dividing, by the square of your height in meters. Write a program that prompts the user to enter a weight in pounds and height in inches and displays the BMI. Note one pound is 0.45359237 kilograms and one inch is 0.0254 meters. Here is a sample run: Enter weight in pounds: 95. Enter height in inches: 50 BMI is 26. 3.32 (Geometry: point position) Given a directed line from point p0(x0, y0) to p1(x1,y1), you can use the following condition to decide whether a point p2(x2, y2) is on the left of the line, on the right, or on the same line (see Figure 3.11): 5.49 (Count Vowels and consonants) Assume that the letters A, E, O, U, and I are vowels. Write a program that prompts the user to enter a string, and displays the number of vowels and consonants in the string. Enter a string: Programming is fun The number of vowels is 5 The number of consonants is 11 1