CIS355A Week 1 Lab—Developing an OOP Console Application
Objectives
· Create a class in Java with appropriate methods.
· Process user input with the class using the scanner for keyboard input and console output.
Problem: Health Profile Console Program
GymsRUs has a need to provide fitness information to their clients, including BMI and maximum heart rate. Your task is to write a console program to do this.
Body mass index (BMI) is a measure of body fat based on a person’s height and weight. BMI can be used to indicate if you are overweight, obese, underweight, or normal. The formula to calculate BMI is
The following BMI categories are based on this calculation.
Category BMI Range
Underweight less than 18.5
Normal between 18.5 and 24.9
Overweight between 25 and 29.9
Obese 30 or more
Max heart rate is calculated as 220 minus a person’s age.
Functional Requirements
Design and code a class called HealthProfile to store information about clients and their fitness data. The attributes (name, age, weight, and height) are private instance variables. The class must include the following methods.
Recent Comments