The Harrison Group Life Insurance company computes annual policy premiums based
ID: 644572 • 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);
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.