Answer to Question #265509 in Java | JSP | JSF for FRED

Question #265509

Java is known to be an object oriented program. Objects are also known to exist in real life. You have been invited as a computer science student to distinguish between real life objects and object found in object oriented program OOP (5 marks) b. Write an OOP to compare the risk factor that will lead to high payment of life insurance premium. The variables to consider are: age, weight, and height


1
Expert's answer
2021-11-13T23:53:11-0500
import java.util.Scanner;
public class Main
{
	public static void main(String[] args) {
	    Scanner in=new Scanner(System.in);
	    System.out.println("Enter age: ");
		int age=in.nextInt();
		System.out.println("Enter weight: ");
		int weight=in.nextInt();
		System.out.println("Enter height: ");
		int height=in.nextInt();
		
		if(age>45 && height>4 && weight>70){
		    System.out.println("\nHigh payment of life insurance premium");
		}
		else{
		    System.out.println("\nLow payment of life insurance premium");
		}
	}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS