Lab project
Budget: $10 – $30 USD
LAB – Selection
1) Minimum/Maximum: Write a program that asks the user to enter two numbers. The program
should use the conditional operator to determine which number is the smaller and which is the
larger. The program should display to the user which number is larger and which number is
smaller or if the two numbers are equal.
2) Roman Numeral Converter: Write a program that asks the user to enter a number between 1
and 10 inclusive. The program should then display the Roman numeral version of that number.
Don’t allow the program to accept a number less than 1 or greater than 10.
Display your output in the format below:
You entered: [userNumber]
The Roman Numeral Equivalent is: [romanNumeral]
3) Areas of Rectangles: The area of a rectangle is calculated by multiplying its length times its
width. Write a program that asks the user for the length and the width of two rectangles. The
program should display to the user which rectangle has the greater area or if the areas are equal.
4) Body Mass Index: Write a program that calculates and displays a person’s body mass index
(BMI) when the user provides their weight and height. The BMI is often used to determine
whether a person is overweight or underweight for his or her height. A person’s BMI is
calculated with the following formula:
BMI = (weight in lbs * 703)/ (height in inches)2
Where weight is measured in pounds and height is measured in inches. The program should
display a message indicating whether the person has optimal weight (BMI between 18.5 and 25
inclusive), is underweight (BMI less than 18.5), or is overweight (BMI greater than 25).
1) Minimum/Maximum: Write a program that asks the user to enter two numbers. The program
should use the conditional operator to determine which number is the smaller and which is the
larger. The program should display to the user which number is larger and which number is
smaller or if the two numbers are equal.
2) Roman Numeral Converter: Write a program that asks the user to enter a number between 1
and 10 inclusive. The program should then display the Roman numeral version of that number.
Don’t allow the program to accept a number less than 1 or greater than 10.
Display your output in the format below:
You entered: [userNumber]
The Roman Numeral Equivalent is: [romanNumeral]
3) Areas of Rectangles: The area of a rectangle is calculated by multiplying its length times its
width. Write a program that asks the user for the length and the width of two rectangles. The
program should display to the user which rectangle has the greater area or if the areas are equal.
4) Body Mass Index: Write a program that calculates and displays a person’s body mass index
(BMI) when the user provides their weight and height. The BMI is often used to determine
whether a person is overweight or underweight for his or her height. A person’s BMI is
calculated with the following formula:
BMI = (weight in lbs * 703)/ (height in inches)2
Where weight is measured in pounds and height is measured in inches. The program should
display a message indicating whether the person has optimal weight (BMI between 18.5 and 25
inclusive), is underweight (BMI less than 18.5), or is overweight (BMI greater than 25).
Related categories:
Business, Accounting, Human Resources & Legal
JavaScript
MySQL
Database Development
Netbeans