Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assignment 3-1 (15 points): Using JOptionPane Boxes to Calculate Interest Your goal is to ask the user 3 different questions with 3 different dinlog boxes

image text in transcribed
image text in transcribed
Assignment 3-1 (15 points): Using JOptionPane Boxes to Calculate Interest Your goal is to ask the user 3 different questions with 3 different dinlog boxes concerning dollars borrowed, interest rate, and number of years borrowed. The computer should then calculate simple interest and display all 4 pieces of information in sentence form on a dialog box. Your program should have the following: . The name of the project should be interest 4 comment lines (purpose of the program, author, date and JDK used) In the main method, you should have a dialog box appear on screen that requests the user to type in amount of dollars borrowed (similar to the following): ( point) Input ? How many dollars do you wish to borrow? 2000 Cancel Place the response that a user types in into a String variable Convert that String using the parseDowble method in Double class and place this double into a variable named dollars. (2 points) Have a dialog box appear on screen that requests the interest rate from user (similar to the following): ( point) Input What is the interest rate? OK Cancel . Place the response that a user types in into a string variable. Convert that string using the parseDouble method in Double class and place this double into a variable named rate (2 points) Have a dialog box appear on screen that requests the number of years of the loan from user (similar to the following: ( point) . Input X ? How many years will you take the loan? (whole numer) no OK Cancel Place the response that a user types in into a String variable. Convert that string using the parseInt method in Integer class and place this int into a variable named years. (2 points) Have the computer calculate the total interest and save in a variable. (2 points) dollars * years * rate/100 Have the computer display a message with the show Message Dialog method that will produce something that looks like the following: (2 points) Message you borrow 2000.0 at an interest rate of 5.85 for 10 years, you will pay 1170.0 in interest OK Note: This will require using concatenation of signs and escape code of etc. This is a very long statement that should be broken up at + signs and span over several lines of code. Make sure to have spaces between words and numbers, If everything compiles and executes correctly, you should get the above answer of 1170.0 when you type in 2000, 5,85 and 10, Format the interest of 1170.0 so that it shows dollars and cents with 2 decimals. (2 points) Message Wyou borrow $2,000.00 at an wterest rate of 5.05 for 10 years, you will pay $1,170.00 in interest OK

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems Design Implementation And Management

Authors: Peter Rob, Carlos Coronel

3rd Edition

0760049041, 978-0760049044

More Books

Students also viewed these Databases questions