Critical Thinking Exerise Redesign the program Realtorjava w

Critical Thinking Exerise: Redesign the program Realtor.java, which you created in ritical Thinking Exercise: Redesign the program Realtor.java, which Chapter 2 and saved to the device or location specified by your instructor Use a dialog box to ask the user to enter the last name of the homeowner. Use another dialog box to ask the user to enter the selling price of the home. Use a third dialog box to display a message with the owner\'s name, the selling price of the home, the cost to the owner to sell the home, and the amount of the commission the selling agent will receive. Format the decimal output showing two decimal places. 1. a. Write your design in the following space.Your design should be a list of Java comments with- out any code.

Solution

import javax.swing.JFrame;

import javax.swing.JOptionPane;

public class home1 {

public static void main(String args[])

{

JFrame frame = new JFrame(\"Realtor Application\");

String lname = JOptionPane.showInputDialog(frame,

\"This program asks the user for a name and selling\ amount of a home,and then calculates the cost to sell the home\ and the commission of an individual sales agent.\ \ Please input the owner\'s last name:\",

\"Input\");

  

String sprice = JOptionPane.showInputDialog(frame,

\"Please enter the sales price of the home:\",

\"Input\");

  

int price=Integer.parseInt(sprice);

  

JOptionPane.showMessageDialog(frame,

\"The \"+lname+\"\'s home sold for $\"+(price*1.0)

+\"\ The cost to sell the home was $\"+(price*0.6)

+\"\ The selling or listing agent earned $\"+(price*0.015),

lname+\"\'s Home Sale\",

JOptionPane.PLAIN_MESSAGE);

}

}

 Critical Thinking Exerise: Redesign the program Realtor.java, which you created in ritical Thinking Exercise: Redesign the program Realtor.java, which Chapter

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site