EssayNICE | 24/7 Homework Help

Essaynice Will Help You Write Your Essays and Term Papers

Answered » You can buy a ready-made answer or pick a professional tutor to order an original one.

Assignment help 8002

by | Jun 24, 2023 | Posted Assignments

Implement and test a HeighAndWeight class as given in the lecture notes.

The class should include:

  • Private variables of type double for height and weight
  • A constructor that is passed an initial height (in inches) and weight (in pounds).
  • Getter methods (but no setter methods, i.e., make an immutable type)
  • A toString method
  • A BMI method (returning type double)
  • A healthyBMI method (returns true only if BMI in normal range – see Wikipedia)
  • A getDescript method (returns either “underweight”, “normal”, “overweight”, or “obese
  • (based on what provided in Wikipedia)
  • A convertToMetric method that returns a new HeightAndWeight object containing the
  • height and weight in meters and kilograms
  • In addition, the following private method should be created called by the public methods for any needed conversions,
  • convertToMeters – returns the current height converted to meters (return type double)
  • convertToKgs – returns the current weight converted to meters (return type double)
  • STAGE 2
  • Develop a simple program that creates objects of type HeightAndWeight and tests that all aspect of the
  • HeightAndWeight class function correctly. Such a program is called a test driver.

HOME TO CERTIFIED WRITERS

Why Place An Order With Us?

  • Certified Editors
  • 24/7 Customer Support
  • Profesional Research
  • Easy to Use System Interface
  • Student Friendly Pricing

Have a similar question?

PLAGIRAISM FREE PAPERS

All papers we provide are well-researched, properly formatted and cited.

TOP QUALITY

All papers we provide are well-researched, properly formatted and cited.

HIGHLY SECURED

All papers we provide are well-researched, properly formatted and cited.

Open chat
1
Powered by essaynice
Hello! Welcome to to our whatapp support.
We offer READY solutions, HIGH QUALITY PLAGIARISM FREE essays and term-papers.

We are online and ready to help