Task 01: Create the Insurance class. Task 02: The calculatePremium() calculates and returns the premium. Task 03: The Insurance program accepts a current year and date of birth from the user and displays the premium.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

 

Task 01: Create the Insurance class.

Task 02: The calculatePremium() calculates and returns the premium.

Task 03: The Insurance program accepts a current year and date of birth from the user and displays the premium.

 

U
18
8
8.9
2
Ö
The f Answ Qinsur java
https://literate-sniffle-x5wx9wg5x7w4fr5r.github.dev/?folder=/workspaces/9780357673423_java-programming...
EXPLORER
✓ STUDENT CODESPACES: LITERATE SNIFFLE
J Insurance.class
J Insurance java
Mind C (X Q The c
J Insurance java x
J Insurancejava > s Insurance >main(String)
1 // write your code
3
5
6
7
8
9
your cout TY
here
import java.util.Scanner;
public class Insurance
public static void main(String args[]) {
int-curr,birth, ant
dân
18
19
18
curr. sc.nextInt();
11 System.out.println("Enter a birth-year: ");
12 birth.sc.nextint(); [
13
28
21
22
23
24
25
Scanner-sc..new Scanner(System.in); //-Reading from System.in
System.out.println("Enter a current year: ");
java
ant- calculatePremium(curr,birth);
System.out.println("Premium-Amount:"+at+"$");
14
15 1
16 public static int calculatePremiumn(int cure, int birth)
17 (
int-age,decades, pr; //pr. for presium amount
age-curr-birth;
decades age10;
perconc
pr (decades+15)*20;
return.pr
26 }
27 1
cheg
PROBLEMS OUTPUT DEBUG CONSOLE TERMINAL POUS COMMENTS
Bas
Enter a birth years
www
Pracunt:384
>
OUTLINE
> TIMELINE
> JAVA PROJECTS
Codespaces: literate siffle template" ☺ ☺☺AO 21 Jave:Lightweight Mode
bo225.../5786357673423_jawa-programming-380-5683flac-c9c6-4288-9022-37336c529045/chapter3/ew28/student (template) $1
form
student Codespaces:erate siffle
cheg
cheg
☐
Welcome
IF Companion X
How to Use the Code Editor
X
15
x
chega debu
1. Select the "Run Code" button to execute the program.
2. Select the "Calculate Grade" button to generate a score based on the completed tasks.
3. Continue to modify, run, and calculate your code until you are happy with the grade.
4. Select the "Submit button to turn in the assignment to your instructor.
Task 01: Create the Insurance class.
RUN CODE
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 customer'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.
A" ☆
Create a class called Insurance that prompts a user for the current year and a birth year. Pass both to a method called
calculatePremium() that calculates and returns the premium amount, and then display the returned amount.
An example of the program is shown below:
Enter the current year >> 2821
Enter the birth year >> 1988
The premium is $380
Your current grade is: 33.33%
cheg
3
Task 02: The calculatePremium() calculates and returns the premium.
3//student Insurance
@bowan3225 →.../5786357673423_java-programming-380-5183Plac-c9c6-4288-9022-37336c529045/chapter3/cw28/student (template) $ java -cp "/workspaces/9788957673423_java-programing-380-583Plac-c9c6-4288-9022-37326c529045/chapter3/28/student Insurance
Enter a current years
3001
New +
CALCULATE GRADE
וח
Task 03: The Insurance program accepts a current year and date of birth from the user and displays the premium.
A No changes detected in the programming files. x
DE
SUBMIT
()
O
1...
▲
V
Layout: US
x
bash
Program O...
Transcribed Image Text:U 18 8 8.9 2 Ö The f Answ Qinsur java https://literate-sniffle-x5wx9wg5x7w4fr5r.github.dev/?folder=/workspaces/9780357673423_java-programming... EXPLORER ✓ STUDENT CODESPACES: LITERATE SNIFFLE J Insurance.class J Insurance java Mind C (X Q The c J Insurance java x J Insurancejava > s Insurance >main(String) 1 // write your code 3 5 6 7 8 9 your cout TY here import java.util.Scanner; public class Insurance public static void main(String args[]) { int-curr,birth, ant dân 18 19 18 curr. sc.nextInt(); 11 System.out.println("Enter a birth-year: "); 12 birth.sc.nextint(); [ 13 28 21 22 23 24 25 Scanner-sc..new Scanner(System.in); //-Reading from System.in System.out.println("Enter a current year: "); java ant- calculatePremium(curr,birth); System.out.println("Premium-Amount:"+at+"$"); 14 15 1 16 public static int calculatePremiumn(int cure, int birth) 17 ( int-age,decades, pr; //pr. for presium amount age-curr-birth; decades age10; perconc pr (decades+15)*20; return.pr 26 } 27 1 cheg PROBLEMS OUTPUT DEBUG CONSOLE TERMINAL POUS COMMENTS Bas Enter a birth years www Pracunt:384 > OUTLINE > TIMELINE > JAVA PROJECTS Codespaces: literate siffle template" ☺ ☺☺AO 21 Jave:Lightweight Mode bo225.../5786357673423_jawa-programming-380-5683flac-c9c6-4288-9022-37336c529045/chapter3/ew28/student (template) $1 form student Codespaces:erate siffle cheg cheg ☐ Welcome IF Companion X How to Use the Code Editor X 15 x chega debu 1. Select the "Run Code" button to execute the program. 2. Select the "Calculate Grade" button to generate a score based on the completed tasks. 3. Continue to modify, run, and calculate your code until you are happy with the grade. 4. Select the "Submit button to turn in the assignment to your instructor. Task 01: Create the Insurance class. RUN CODE 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 customer'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. A" ☆ Create a class called Insurance that prompts a user for the current year and a birth year. Pass both to a method called calculatePremium() that calculates and returns the premium amount, and then display the returned amount. An example of the program is shown below: Enter the current year >> 2821 Enter the birth year >> 1988 The premium is $380 Your current grade is: 33.33% cheg 3 Task 02: The calculatePremium() calculates and returns the premium. 3//student Insurance @bowan3225 →.../5786357673423_java-programming-380-5183Plac-c9c6-4288-9022-37336c529045/chapter3/cw28/student (template) $ java -cp "/workspaces/9788957673423_java-programing-380-583Plac-c9c6-4288-9022-37326c529045/chapter3/28/student Insurance Enter a current years 3001 New + CALCULATE GRADE וח Task 03: The Insurance program accepts a current year and date of birth from the user and displays the premium. A No changes detected in the programming files. x DE SUBMIT () O 1... ▲ V Layout: US x bash Program O...
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY