Starting Out with Java: From Control Structures through Data Structures (3rd Edition)
Starting Out with Java: From Control Structures through Data Structures (3rd Edition)
3rd Edition
ISBN: 9780134038179
Author: Tony Gaddis, Godfrey Muganda
Publisher: PEARSON
bartleby

Concept explainers

bartleby

Videos

Question
Book Icon
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 a class “SalesTax”.
      • Define the main method.
      • Create the object of “MonthlySalestax”.

Blurred answer
Students 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 enterthe 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 officebusiness at a theater:• Gross revenue for adult tickets sold. This is the amount of money taken in for all adulttickets sold.• Net revenue for adult tickets sold. This is the amount of money from adult ticket salesleft 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 childtickets sold.• Net revenue for child tickets sold. This is the amount of money from child ticket salesleft over after the payment to the movie company has been deducted.• Total gross revenue. This is the…

Chapter 12 Solutions

Starting Out with Java: From Control Structures through Data Structures (3rd Edition)

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
Background pattern image
Computer Science
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
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Text book image
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