Answer to Question #335511 in HTML/JavaScript Web Application for Penwell

Question #335511

4. The Litsemba Life Insurance company computes annual policy premiums based on the age the customer turns in the calendar year. The premium is computed by taking the decade of the customer's age, adding 15 to it, and multiplying by 20. Write a Java application that prompts the user for the current year and birth year. Pass both to method that calculates and returns the premium amount and display the returned amount. Application should be saved as Insurance.java . Note: the customer age should not be more than 59 years. [10 Marks]


1
Expert's answer
2022-04-29T18:23:04-0400
let age = 34;

if (age > 59) {
    console.log('Incorrect age!');
} else {
    let extra = (parseInt(age / 10) + 15) * 20;
    console.log('Value is ' + extra);
}





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