QuizCh8022509[1] - b. Create a class named TestCheckup...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
CIS 106: Ch 8 User-Defined Classes 02/25/09 1. a. Create a class named Checkup with fields that hold a patient number, systolic and diastolic, for blood pressure, and two cholesterol figures (LDL and HDL). Include methods to set and get each of the fields. Include a method named computeRatio() that divided LDL cholesterol by HDL cholesterol and displays the result. Include an additional method named ExplainRatio() that explains that HDL is “good cholesterol” and that a ratio of 3.5 or lower is considered optimum.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: b. Create a class named TestCheckup whose main() method declares four Checkup objects. Provide values for each field for each patient, and then display the values. Blood pressure numbers are usually displayed with a slash between the systolic and diastolic values. (Typical numbers are values such as 110/78 or 130/90). With the cholesterol figures, display the explanation of the cholesterol ratio calculation. (Typical cholesterol numbers are values such as 100 and 40 or 180 and 70)....
View Full Document

This note was uploaded on 10/04/2010 for the course COMPUTER S 106 taught by Professor Moore during the Spring '08 term at Clark Atlanta.

Ask a homework question - tutors are online