This assignment is a modification of Assignment 1. The main difference is that instead of using the System.in.* and System.out.* methods, your will be using the JOptionPane class for all the inputs / outputs. Section 1: Java Program File(s) Modify the Java program that you created from Assignment 1. According to your design, the program must: •Use the JOptionPane class to create a driver program to test your Assignment 1 InsuranceAgentApp Java application. •Display a new driver test program’s user interface Insurance Agent App The new driver test program’s user interface from Question 1b must: •Include a loop to display the user interface until the user clicks the Quit button. •Instantiate a PropertyInsurance object and use the JOptionPane.showInputDialog() method to capture the type and riskAmount when the user clicks the Property button. •Instantiate an AutomobileInsurance object and use the JOptionPane.showInputDialog() method to capture the type and riskAmount when the user clicks the Automobile button. •Instantiate a TravelInsurance object and use the JOptionPane.showInputDialog() method to capture the type and riskAmount when the user clicks the Travel button. •Display the quote (totalPremium in the InsuranceAgentApp class) when the user clicks the “Get a Quote” button. •End when the user clicks the “Quit” button

Assignment 2: Modification of Assignment 1 – Using the JOptionPane Class

Section 1: Java Program File(s)

In this assignment, we will be modifying the Java program created in Assignment 1. The main difference is that instead of using the System.in.* and System.out.* methods for input/output, you will be utilizing the JOptionPane class for all inputs and outputs.

Your program must adhere to the following design specifications:

1. Use the JOptionPane class to create a driver program that tests your Assignment 1 InsuranceAgentApp Java application.
2. The new driver test program’s user interface, called “Insurance Agent App,” should be displayed.
3. Implement a loop that will continuously display the user interface until the user clicks the “Quit” button.
4. Create an instance of the PropertyInsurance class and use the JOptionPane.showInputDialog() method to capture the type and riskAmount when the user clicks the “Property” button.
5. Create an instance of the AutomobileInsurance class and use the JOptionPane.showInputDialog() method to capture the type and riskAmount when the user clicks the “Automobile” button.
6. Create an instance of the TravelInsurance class and use the JOptionPane.showInputDialog() method to capture the type and riskAmount when the user clicks the “Travel” button.
7. Display the quote (totalPremium in the InsuranceAgentApp class) when the user clicks the “Get a Quote” button.
8. End the program when the user clicks the “Quit” button.

By using the JOptionPane class, you will be able to create a more user-friendly interface for your program. Instead of relying on the command line for input and output, the JOptionPane class provides dialog boxes for input and message boxes for output. This enhances the overall user experience and makes the program more intuitive to use.

The implementation of a loop ensures that the user interface will continue to be displayed until the user chooses to exit the program. This prevents the program from terminating prematurely and allows users to interact with the application as long as they desire.

Using the JOptionPane.showInputDialog() method, you can capture the necessary input from the user for each insurance type (property, automobile, and travel). This method allows you to display a dialog box and retrieve user input in a streamlined manner.

Finally, displaying the quote (totalPremium) when the user clicks the “Get a Quote” button ensures that the user can easily view the final result of their insurance inquiry. This enhances transparency and provides immediate feedback to the user.

Overall, the modification of the original program to utilize the JOptionPane class improves the user interface and provides a more efficient way of interacting with the application. The new driver test program’s user interface allows for seamless navigation between insurance types and ensures a smooth user experience.

Need your ASSIGNMENT done? Use our paper writing service to score better and meet your deadline.


Click Here to Make an Order Click Here to Hire a Writer