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

Question #334459

4. The Litsemba Group 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. For example, a 34 year would pay R360 which is calculated by adding the decades (3) to 15 and multiplying by 20. Write a Java application that prompts a user for the current year and a birth year. Pass both to method that calculates and returns the premium amount and display the returned amount. Application should be named Insurance.java . Note: The customer should not be older than 59 years . [10 Marks]


1
Expert's answer
2022-04-27T18:25:08-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