I have this assignment and I am lost on it. I think I have it written but it continuosly gives an error cannot find symbol on (Checkup check). I am lost and in desperate need of help.
Here is my assignment:
Create a class named TestCheckup whose main() method declares four Checkup objects. Call a getData() method four times. Within the method, prompt a user for values for each field for a Checkup, and return a Checkup object to the main() method where it is assigned to one of main()’s Checkup objects. Then, in main(), pass each Checkup object in turn to a showValues() method that displays the data. Blood pressure values are usually displayed with a slash between the systolic and diastolic numbers. (Typical blood pressure values are 110/78 or 130/90.) With the cholesterol figures, display the explanation of the cholesterol ratio calculation. (Typical cholesterol values are 100 and 40 or 180 and 70.) The comment header provided in Unit 1 should be added and completed. Save the Assignment as TestCheckup.java and take a screenshot of each of the following: the newly written code, the code after it is compiled, and the output of the code.
Here is the code:
import java.util.Scanner; public class TestCheckup { //begin class public static void main(String[] args) { //Create four checkup objects Checkup check1 = new Checkup(); Checkup check2 = new Checkup(); Checkup check3 = new Checkup(); Checkup check4 = new Checkup(); //Pass Checkup objects to getData method getData(check1); getData(check2); getData(check3); getData(check4); //Pass Checkup objects to showValues() method showValues(check1); showValues(check2); showValues(check3); showValues(check4); } public static Checkup getData(Checkup check) { //Create scanner object Scanner keyboard = new Scanner(System.in); //Prompt user for field data values and return values System.out.println("Please enter stylostic pressure: " ); check.stylostic = keyboard.nextInt(); System.out.println("Please enter diastolic pressure: "); check.diastolic = keyboard.nextInt(); System.out.println("Please enter hdl: "); check.hdl = keyboard.nextInt(); System.out.println("Plese enter ldl: "); check.ldl = keyboard.nextInt(); return check; } public static void showValues(Checkup checker) { System.out.println("Your blood pressure is " + checker.diastolic + "/" + checker.stylostic); System.out.println("Your cholesterol is " + checker.hdl + " and " + checker.ldl); System.out.println("Typical cholestoral is 100 and 40 or 180 and 70"); } }