Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The Harrison Group Life Insurance company computes annual policy premiums based

ID: 644530 • Letter: T

Question

The Harrison Group Life Insurance company computes annual policy premiums based on the
age the customer turns in the current calendar year. The premium is computed by taking
the decade of the customre's age, adding 15 to it, and multiplying by 20. For example,
a 34-year-old would pay $360, which is calculated by adding the decades (3) to 15, and
then multiplying by 20.
Write an application that prompts a user for the current year and then display the
returned amount. Save the application as Insurance,java.

Explanation / Answer

import java.util.*;
public class insurance {

public static void main(String args[]) {
  
//Creating Scanner instance to scan console for User input
Scanner console = new Scanner(System.in);
  
System.out.println("System is ready to accept input, please enter age: ");
int age = console.nextInt();
  
int d = age/10;
  
System.out.println("decade is"+d);

int add=d+15;
int premium =add*20 ;
System.out.println("total premium amount "+premium);
  

}

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote