1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
lana66690 [7]
4 years ago
9

ST Insurance Brokers, Inc. needs your help to create a program to calculate the total cost of insurance policies issued by its b

rokers. Write a small Java program that prompts the user for a type of insurance policy and then determines the total policy cost. The company currently supports only three types of insurance policies: Apartment, Auto, and Condo. When a user enters a different type of insurance policy, they should be told the program does not support that type of insurance policy at this time. Use the information below to determine total policy cost: Apartment - Has a base cost of $300.00 with the option to purchase premium protection for an additional $175.00 Auto - Has a base cost of $200.00 Condo - Has a base cost of $300.00 with the option to purchase premium protection for an additional $175.00 The example run below shows how the program would run. Note, user input is denoted in orange. Example run #1 What type of insurance do you need? Apartment Would you like premium protection? yes The Apartment insurance you selected costs $475.00. Example run #2 What type of insurance do you need? Auto The Auto insurance you selected costs $200.00. Example run #3 What type of insurance do you n
Computers and Technology
1 answer:
a_sh-v [17]4 years ago
5 0

Answer:

package form;

import javax.swing.JOptionPane;

public class ISTInsuranceBrokers

{

public static void main(String[] args)

{

while(true){

String policy;

double totalCost=0;

String options = "Please enter anyone of the below policy type"+

"\n1. Apartment"+

"\n2. Auto"+

"\n3. Condo";

policy = JOptionPane.showInputDialog(options);

if(policy!=null){

if(policy.equalsIgnoreCase("Apartment") || policy.equalsIgnoreCase("Condo")){

totalCost+=300;

int val = JOptionPane.showConfirmDialog(null,

"Would you like to purchase premium protection for an additional $175.00",

"Addional info!!!",

JOptionPane.YES_NO_OPTION);

if(val==0){

totalCost+=175;

}

}else if(policy.equalsIgnoreCase("Auto")){

totalCost+=200;

}else{

int val = JOptionPane.showConfirmDialog(null,

"the program does not support that type of insurance policy at this time. Would you like to buy other policy?",

"Buy Confirmation!!!",

JOptionPane.YES_NO_OPTION);

if(val!=0){

System.exit(0);

}

if(val==0){

continue;

}

}

int val = JOptionPane.showConfirmDialog(null,

"Policy cost is : $"+totalCost*1.00+". Click yes to buy",

"Buy Confirmation!!!",

JOptionPane.YES_NO_OPTION);

if(val==0){

totalCost+=175;

break;

}

}else{

break;

}

}

}

}

Explanation:

  • Check if policy is not null, then add 300 to the totalCost variable.
  • Check if the val variable is equal to 0, then add 175 to the totalCost variable.
You might be interested in
Write. true or false​
ella [17]
Um I need a image or smth
8 0
3 years ago
Read 2 more answers
Que compone una maquina Rube Goldberg (operadores mecánicos- maquinas simples – mecanismos)
Veseljchak [2.6K]

Answer:

dominoes, fans, PVC pipe, magnets, duct tape, marbles, cups or bowls, miniature toy cars, paper towel tubes, string.

------------------------------------------------------------------------------------------------------------

dominó, abanicos, tubos de PVC, imanes, cinta adhesiva, canicas, tazas o cuencos, carros de juguete en miniatura, tubos de toallas de papel, cuerdas.

Explanation:

3 0
3 years ago
In general, WAN-specific standards identify specific security requirements for WAN devices. For example, the ___________________
allsm [11]

Answer:

WAN router security standard, Web services standard

Explanation:

Complete statement with blanks filled:

In general, WAN-specific standards identify specific security requirements for WAN devices. For example, the WAN router security standard explains the family of controls needed to secure the connection from the internal network to the WAN router, whereas the Web services standard identifies which controls are vital for use of Web services provided by suppliers and external partnerships.

7 0
3 years ago
Many web pages today use ____ —small text files that are stored on your hard drive by a web server, typically the one associated
elena-14-01-66 [18.8K]
The data of the webpages on the Internet are commonly stored into hard drives from servers around the world. These supercomputers have the capability to store huge chunks of data just to keep the web page from running. The HTTP protocol is the one that allows for these servers to store data.
3 0
3 years ago
Read 2 more answers
(Bible)<br> Sin may be an inward thought or an outward act. True False
koban [17]
True it could come out as may come across as inward and outward
4 0
3 years ago
Read 2 more answers
Other questions:
  • Write a loop that sets newScores to oldScores shifted once left, with element 0 copied to the end. Ex: If oldScores = {10, 20, 3
    15·1 answer
  • Nonvolatile in the context of data storage means ________________. a. the data can't be changed in a data warehouse. b. the data
    11·1 answer
  • What is used to monitor the activity of a network and notify network administrators when it identifies something as suspicious?
    15·1 answer
  • For a class project, Jerome builds a simple circuit with a battery and three light bulbs. On his way to school, Jerome drops his
    9·1 answer
  • You are requesting information about wireless connectivity for your workplace computers. Because you expect the information to b
    15·1 answer
  • Jared recently sent an email to all the members of his department asking them for their opinions about where the department shou
    11·1 answer
  • Henry has created a software product that manages a database of company clients. He wants to install the software on a client's
    13·1 answer
  • LCD, EL and gas-plasma are types of flat-panel screens.<br> True<br> False
    13·1 answer
  • Which actions represent parody?
    5·1 answer
  • What are the advantages of cloud computing over computing on premises?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!