Question: Object-oriented programming 1. Consider the following class declaration. Identify invalid statements in the following main class. For each invalid statement, state why it is invalid.

 Object-oriented programming 1. Consider the following class declaration. Identify invalid statementsin the following main class. For each invalid statement, state why itis invalid. class Q1Main f public static void main( String[] args )\{ Questionone q1; q1= new Questionone(); q1A=12; q1b=12; q1c=12; q1.methodone ( 12) ; q1 .methodone () ; system.out.println( q1.methodTwo ( 12 ) ); q1c=q1 methodTwo (); \} 2. What will be the output from Object-oriented programming

1. Consider the following class declaration. Identify invalid statements in the following main class. For each invalid statement, state why it is invalid. class Q1Main f public static void main( String[] args ) \{ Questionone q1; q1= new Questionone(); q1A=12; q1b=12; q1c=12; q1.methodone ( 12 ) ; q1 .methodone () ; system.out.println( q1.methodTwo ( 12 ) ) ; q1c=q1 methodTwo (); \} 2. What will be the output from the following code? class QuestionTwo \{ private int count; public void init ( ) \{ count =1; public void increment ( ) \{ count = count +1; public int getCount ()\{ return count; ; What will be the output from the following code? Q3Main and QuestionThre classes are the slightly modified version of Q2Main and QuestionTwo. 4. Create a class named Checkup with fields that hold a patient number, two blood pressure figures (systolic and diastolic), and two cholesterol figures (LDL and HDL). Methods: i. get and set for each of the fields ii. computecholestrolRatio() that divides LDL cholesterol by HDL cholesterol and returns the result. iii. explaincholestrolRatio() that explains that HDL is known as "good cholesterol" and that a ratio of 3.5 or lower is considered optimum. iv. bloodpressure() that displays blood pressure category based on the following table: v. Include the main () method and creates a Checkup object and demonstrate its methods

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!