Starting Out with Java: From Control Structures through Data Structures (3rd Edition)
3rd Edition
ISBN: 9780134038179
Author: Tony Gaddis, Godfrey Muganda
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 12, Problem 2PC
Program Plan Intro
Monthly Sales Tax
Program plan:
- Import the required packages.
- Define a frame named “MonthlySalesTax”.
- Declare a JPanel named “panel”.
- Declare a JTextFeild named “JTextFeild”.
- Declare a JButton “salestaxButton”.
- Declare the variables for window height and width.
- Define a method “MothlySalesTax()”.
- Set the title for the window.
- Set the size and width of the window.
- Call the function “buildPanel()” for creating panel.
- Call the function “add()” for adding the panel to the frame.
- Set the window as visible.
- Define a function “buildPanel()”.
- Create a label variable.
- Create a text field.
- Create a button “salestaxButton”.
- Register the created button for handling events.
- Create the object of JPanel.
- Add the created components to the panel.
- Define a class “CalculateMST”.
- Define the method “actionPerformed” for handling the events.
- Declare the required variables.
- Get the value for variable “input” from the user.
- Calculate the country tax.
- Calculate the state tax.
- Calculate the total tax.
- Print the calculated values in a message box.
- Define the method “actionPerformed” for handling the events.
- Define a class “SalesTax”.
- Define the main method.
- Create the object of “MonthlySalestax”.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
A county collects property taxes on the assessment value of property, which is 60 percent of the property's actual value. If an acre of land is valued at $10,000, its assessment value is $ 6,000. The property tax is then $0.64 for each $100 of the assessment value. The tax for the acre assessed at $6,000 will be $38.40. Create a GUI application that displays the assessment value and property tax when a user enters the actual value of a property.
A county collects property taxes on the assessment value of property, which is 60 percent of the property's actual value. If an acre of land is valued at $10,000, its assessment value is $ 6,000. The property tax is then $0.64 for each $100 of the assessment value. The tax for the acre assessed at $6,000 will be $38.40. Create a GUI application that displays the assessment value and property tax when a user enters the actual value of a property. in Java
Theater RevenueA movie theater only keeps a percentage of the revenue earned from ticket sales. The remainder goes to the movie company. Create a GUI application that allows the user to enter the following data into text fields:� Price per adult ticket� Number of adult tickets sold� Price per child ticket� Number of child tickets soldThe application should calculate and display the following data for one night�s box office business at a theater:� Gross revenue for adult tickets sold. This is the amount of money taken in for all adult tickets sold.� Net revenue for adult tickets sold. This is the amount of money from adult ticket sales left over after the payment to the movie company has been deducted.� Gross revenue for child tickets sold. This is the amount of money taken in for all child tickets sold.� Net revenue for child tickets sold. This is the amount of money from child ticket sales left over after the payment to the movie company has been deducted.� Total gross revenue. This…
Chapter 12 Solutions
Starting Out with Java: From Control Structures through Data Structures (3rd Edition)
Ch. 12.2 - Prob. 12.1CPCh. 12.2 - Prob. 12.2CPCh. 12.2 - Prob. 12.3CPCh. 12.2 - Prob. 12.4CPCh. 12.2 - Prob. 12.5CPCh. 12.2 - Prob. 12.6CPCh. 12.2 - If you are writing an event listener class for a...Ch. 12.2 - Prob. 12.8CPCh. 12.2 - Prob. 12.9CPCh. 12.3 - Prob. 12.10CP
Ch. 12.3 - Prob. 12.11CPCh. 12.3 - Which layout manager arranges components in a row,...Ch. 12.3 - Prob. 12.13CPCh. 12.3 - Prob. 12.14CPCh. 12.3 - Prob. 12.15CPCh. 12.3 - Prob. 12.16CPCh. 12.3 - Prob. 12.17CPCh. 12.4 - Prob. 12.18CPCh. 12.4 - Prob. 12.19CPCh. 12.4 - Prob. 12.20CPCh. 12.4 - Prob. 12.21CPCh. 12.4 - Prob. 12.22CPCh. 12.4 - Prob. 12.23CPCh. 12.4 - Prob. 12.24CPCh. 12.4 - Prob. 12.25CPCh. 12.5 - Prob. 12.26CPCh. 12.5 - Prob. 12.27CPCh. 12 - With Swing, you use this class to create a frame....Ch. 12 - Prob. 2MCCh. 12 - Prob. 3MCCh. 12 - Prob. 4MCCh. 12 - Prob. 5MCCh. 12 - Prob. 6MCCh. 12 - Prob. 7MCCh. 12 - Prob. 8MCCh. 12 - Prob. 9MCCh. 12 - Prob. 10MCCh. 12 - Prob. 11MCCh. 12 - Prob. 12TFCh. 12 - Prob. 13TFCh. 12 - Prob. 14TFCh. 12 - Prob. 15TFCh. 12 - Prob. 16TFCh. 12 - Prob. 17TFCh. 12 - Prob. 18TFCh. 12 - Prob. 19TFCh. 12 - Prob. 20TFCh. 12 - The following statement is in a class that uses...Ch. 12 - Prob. 2FTECh. 12 - Prob. 3FTECh. 12 - Prob. 4FTECh. 12 - Prob. 5FTECh. 12 - Prob. 1AWCh. 12 - Prob. 2AWCh. 12 - The variable myWindow references a JFrame object....Ch. 12 - Prob. 4AWCh. 12 - Prob. 5AWCh. 12 - Prob. 6AWCh. 12 - Prob. 7AWCh. 12 - Prob. 8AWCh. 12 - Prob. 9AWCh. 12 - Prob. 1SACh. 12 - Prob. 2SACh. 12 - Prob. 3SACh. 12 - Prob. 4SACh. 12 - Retail Price Calculator Create a GUI application...Ch. 12 - Prob. 2PCCh. 12 - Prob. 3PCCh. 12 - Travel Expenses Create a GUI application that...Ch. 12 - Prob. 5PCCh. 12 - Joes Automotive Joes Automotive performs the...Ch. 12 - Prob. 8PC
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- In the IDE, the area where you visually construct a Form is the ________. a. Toolbox b. Form Designer c. Easel d. Sandboxarrow_forwardA county collects property taxes on the assessment value of property, which is 60 percent of the property’s actual value. If an acre of land is valued at $10,000, its assessment value is $6,000. The property tax is then $0.64 for each $100 of the assessment value. The tax for the acre assessed at $6,000 will be $38.40. Create a GUI application that displays the assess- ment value and property tax when a user enters the actual value of a property.arrow_forwardTip, Tax, and Total Create an application that lets the user enter the food charge for a meal at a restaurant. When a button is clicked, the application should calculate and display the amount of a 15 percent tip, 7 percent sales tax, and the total of all three amounts.arrow_forward
- All controls' attributes influence whether they display on the form during runtime.arrow_forwardproperty Tax in javaA county collects property taxes on the assessment value of property, which is 60 percent of the property’s actual value. If an acre of land is valued at $10,000, its assessment value is $6,000. The property tax is then $0.64 for each $100 of the assessment value. The tax for the acre assessed at $6,000 will be $38.40. Create a GUI application that displays the assess- ment value and property tax when a user enters the actual value of a property.arrow_forwardQuestion 1 Get room rate Room type single Number of night 3 Room rate 750.00 Get rate Close Figure 2: Get room rate GUI Write a complete program to create a graphical user interface (GUI) which calculate the room rate according to Table 1. The program should calculate and show the room rate in a text field which is not editable when the Get rate button is pressed and the system will be terminated when the Close button is pressed. The size of GUI should be set as 300 x 250. It should be shown in the centre of the screen and the program should shutdown when the user press the close button on the top right corner. Lastly, remember to create an object for the class in a main() method. Table 1: Hotel room rate according to room type Room type single Price in RM (per night) 250 double 320 suite 500arrow_forward
- Latin Translator Look at the following list of Latin words and their meanings: Latin Englishsinister leftdexter rightmedium center Design a GUI program that translates the Latin words to English. The window should have three buttons, one for each Latin word. When the user clicks a button, the program displays the English translation in a label component.arrow_forwardA county collects property taxes on the assessment value of property, which is 60 percent of the property’s actual value. If an acre of land is valued at $10,000, its assessment value is $6,000. The property tax is then $0.64 for each $100 of the assessment value. The tax for the acre assessed at $6,000 will be $38.40. Design a GUI program that displays the assessment value and property tax when a user enters the actual value of a property. Use a class to implement the GUI window display and functionality.arrow_forwardAttributes, like those of other controls, determine whether or not a control appears on a form during application execution.arrow_forward
- Assignment on GUI Create a Java Swing Application named CarShowRoom. You have to first design the UI using swing package and then write event handling code as per the following specifications. Tasks: Use Flow Layout Create a combobox containing the brands of different cars such as Audi, BMW etc. Use 5 brands as per your choice in the combobox. Create a button “show” Create a TextArea which will initially be empty. When an item is selected from the combobox and the button “show” is pressed, that TextArea will show the number of cars of that model available, price of each car, colors available and some unique features of that car. Every time an item is selected from the combobox, the details of this item will be appended to the previous information already showed in the textarea. The TextArea will not be refreshed. Create another TextField which will be invisible till a car is booked (after clicking the button “book”). Create another button “book”. When this button is clicked, the…arrow_forwardAndroid Studio with Javaarrow_forwardSimilar to other controls, a control's attribute affects whether or not it appears on the form during runtime.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Time Complexity Analysis - How To Calculate Running Time | InterviewBit; Author: InterviewBit;https://www.youtube.com/watch?v=--oxG4Q1PA0;License: Standard YouTube License, CC-BY