Answered step by step
Verified Expert Solution
Question
1 Approved Answer
i really need help with understanding the test cases, i have the rest of the code (last 3 photos) i belive. Could someone please help
i really need help with understanding the test cases, i have the rest of the code (last 3 photos) i belive. Could someone please help me out? and correct me if something is wrong? the test cases are only meant to refer to the BMI
The Divergent Series: Allegiant X C Get Homework Help With Che X CUse Javadocs To Document A X Project 2: Patient Class Comp X + C E O https://colstate view.usg.edu/d2/ims/dropbox/user/folder_submit files.d2l?db=18762 0 Description For this project, you get to design a Patient class that stores a patient's first name, height and weight as fields. Include both a constructor without any parameters and one with parameters for name (string), height (double) and weight (double) (in that order). Include appropriate accessor and mutator methods (and label them with comments including the terms "accessor" or "mutator"). Use the naming conventions of setValue() and getValue() (i.e., setName() and getName(), etc.). Appropriately, include the this keyword in your code. Additionally, include a method named toString() that returns a string formatted as in the examples below (including rounding to one decimal place). Include an updateBMI() method that calculates the Body Mass Index of the patient based on the following formula: BMI = 703 * weight_in_lbs / (height_in_inches * height_in_inches). or method named get BMI. Note: make sure that the BMI is correct before returning it. Write at least three test cases for the update BMI () method in a main () method in the Patient class. Put each test case into a different method, named testi(), test2() and ocument both the patient class and its methods with comments and Javadoc comments. Create a Main class that requests input from the user and populates a Patient object and calls it's toString() method. Create a Main class that requests input from the user and populates a Patient object and calls it's toString() method. Submit Cancel Type here to search + C O A d) uie Lonell me type). https://colstate view.usg.edu/d2/ims/dropbox/user/folder_submit files.d2l?db - 187620 Examples for the input and output part (user input in bold face blue) Please enter the patient's first name: Donald You entered Donald Please enter the patient's height (in inches): 75 You entered 75.0 Please enter the patient's weight (in inches): 243.0 You entered 243.0 Patient: Donald is 75.0 inches tall and weighs 243.0 pounds (BMI: 30.4) Please enter the patient's first name: Mary You entered Mary Please enter the patient's height (in inches): 68.0 You entered 68.0 Please enter the patient's weight (in inches): 165 You entered 165.0 Patient: Mary is 68.0 inches tall and weighs 165.0 pounds (BMI: 25.1) and Please enter the patient's first name: Liam You entered Liam Please enter the patient's height (in inches): 72.1 You entered 72.1 Please enter the patient's weight (in inches): 185 You entered 105.0 Patient Liam is 72.1 inches tall and weighs 185.0 pounda (AMII 25.0) C..hmienion Submit Cancel three parts Type here to search UU JOVES IU Document X C 0 https://replit/student/submissions/10734909 replit Project 2 - Patient Cle share your program enhance your work after submitting export to rep : back to classroom run Main.java Patientava public class Patient { private String firstname; //3 fields private double height; private double weight; //Constructor with no parameter public patient 10 //Constructor with parameters firstname, height, weight public patient(String firstname, double height, double weight) { this.firstname = firstname; this.height = height; this.weight = weight; 14 15 - //accesser method for firstname public String getFirstname() { return firstname: 16 17 19- //mutator method for firstname public void setFirstname(String firstname) { this.firstname = firstname; 23 24- //accesser method for height public double getHeight() { return height; Type here to search DALL he Divergent Series: Allegiant X C Get Homework Help With C X Use lavadocs To Document x Pro C C 0 https://repl.it/student/submissions/10734909 replit Project 2 - Patient Class share your program enhance your work after submitting O export to repl : back to classroom run Main.java Patient.java TELITI TIL : 26 27 //mutator method for height public void setHeight(double height) { this.height = height; 29 32- //accesser method for weight public double getWeight() { return weight; 36 - //mutator method for weight public void setWeight(double weight) { this.weight weight; 38 39 - public double updateBMI() { return Math.round((703 - this.weight /(this.height - this.height))*10.0 )/10.; 41 43 public double getBMI() { return updateBMI(); 45 - public String toString() { return "Patient: " + this.firstname + " is " + (Math.round(this.height - 10.0)/10.) + " inches tall and weights" + (Math.round(this.weight 10.0)/10.) + " pounds (BMI: " + this.getBMI() + ")"; Type here to search DALL X x Project 2 The Divergent Series: Allegiant + C C Get Homework Help With C X C Use Javadocs To Document 0 https://repl.it/student/submissions/10737999 repl.it Project 2 - Patient Class (P share your program enhance your work after submitting o export to repl Due: back to classroom run Instru 1- This cla Main.java Patientjava: import java.util.Scanner; class main { public static void main(String args[]) { Scanner sc new Scanner(System.in); System.out.print("Please enter the patient's first name: "); String fname = sc.next(); System.out.println("You entered" + fname); System.out.print("Please enter the patient's height (in inches): "); double height = sc.nextDouble(); System.out.println("You entered: " + (Math.round(height - 10.)/10.)); System.out.print("Please enter the patient's weight (in inches): "); double weight = sc.nextDouble(); System.out.println("You entered: " + (Math.round(weight * 10.)/10.)); Patient patient. = new Patient(fname, height, weight); System.out.println(patient.toString(); 16 17 Type here to search DLL Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started