Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

Assignment: 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/health 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 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 200 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.

Method

Description

setName

Receives a value to assign to private instance variable

setAge

Receives a value to assign to private instance variable

setWeight

Receives a value to assign to private instance variable

setHeight

Receives TWO inputs (height in feet, inches).  Converts and stores the total INCHES in private instance variable

getName

Returns private instance variable

getAge

Returns private instance variable

getWeight

Returns private instance variable

getHeight

Returns private instance variable (inches)

getBMI

Calculates and returns BMI

getCategory

Returns category based on BMI

getMaxHR

Calculates and returns maximum heart rate

Create a SEPARATE TEST CLASS, Lab1Main, to prompt for user input and display output using the HealthProfile class. Process multiple inputs using a loop.You can assume all user input is valid.

Part 2:

Practice 1

Write a program that accepts a distance in kilometers, sends it to a method which converts it to miles, and then displays the result. The formula for conversion is Miles = Kilometers * 0.6214

Practice 2

Insurance companies suggest that people should insure a building for at least 80 percent of the cost to replace it. Write a program that accepts the cost of a building, sends it to a method which calculates the recommended insurance, and then displays the result in a currency format.

Lab Report

Objective/Purpose of the program

Briefly describe the program's requirements.

Analysis/Design

Describe the approach/structure of program.What classes/functions were used?

Testing/Results

Does your program satisfy all requirements of the lab?

If yes, how did you test it? Indicate test cases used, expected values, and show results with screen shots. For example:

Case

Description

Test Data

Expected Result

Actual Result

1

Describe what you are testing

Specify the test data

What is expected

Actual results - reference an image that you include below. 

If any requirements are NOT met, document the known issues. What did you do to try to solve them?

Make sure you demonstrate in your testing the parts that are working correctly.

Conclusions / Lessons Learned

What difficult problems did you encounter, and how did you handle them?
What new concepts did you learn/reinforce with this lab?
Is there anything you would have done differently?

Java, Programming

  • Category:- Java
  • Reference No.:- M92812243

Have any Question?


Related Questions in Java

Overviewyou are required to use java se 80 and javafx to

Overview You are required to use Java SE 8.0 and JavaFX to develop a Graphical User Interface (GUI) for the FlexiRent rental property management program created in Assignment 1. This assignment is designed to help you: 1 ...

Assessment instructionsin this assessment you will design

Assessment Instructions In this assessment, you will design and code a simple Java application that defines a class, instantiate the class into a number of objects, and prints out the attributes of these objects in a spe ...

Chatbotscreate a small networked chat application that is

Chatbots Create a small, networked chat application that is populated by bots. Introduction On an old server park, filled with applications from the early days of the internet, a few servers still run one of the earliest ...

Retail price calculatorwrite a java program that asks the

Retail Price Calculator Write a JAVA program that asks the user to enter an item's wholesale cost and its markup percentage. It should then display the item's retail price. For example: (If an item's wholesale cost is 5. ...

Assessment socket programmingtaskwrite a java gui program

Assessment: Socket Programming Task Write a JAVA GUI program that would facilitate text chatting/exchanging between two or multiple computers over the network/internet, using the concept of JAVA socket programming. If yo ...

Answer the following question whats the difference public

Answer the following Question : What's the difference public inheritance and private inheritance? What can derived classes inherit from base classes? What cannot be inherited from base classes?

Question slideshows or carousels are very popular in

Question : Slideshows (or carousels) are very popular in websites. They allow web developers to display news or images on the website in limited space. In this code challenge, you are required to complete the JavaScript ...

Assignment game prototypeoverviewfor this assessment task

Assignment: Game Prototype Overview For this assessment task you are expected to construct a prototype level/area as a "proof of concept" for the game that you have designed in Assignment 1. The prototype should function ...

Overviewyou are required to use java se 80 and javafx to

Overview You are required to use Java SE 8.0 and JavaFX to develop a Graphical User Interface (GUI) for the FlexiRent rental property management program created in Assignment 1. This assignment is designed to help you: 1 ...

Project requirementsfor the problem described in the next

Project requirements For the problem described in the next section, you must do the following: 1. include your student ID at the end of all filenames for all java code files. Three classes have been identified in section ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As