Question

In: Computer Science

A retail company must file a monthly sales tax report listing the total sales for the month, and the amount of state and county sales tax collected.

A retail company must file a monthly sales tax report listing the total sales for the month, and the amount of state and county sales tax collected. The state sales tax rate is 5 percent and the county sales tax rate is 3 percent. Create a GUI application that allows the user to enter the total sales for the month into a text field. From this figure, the application should calculate and display the following: The number of county sales tax The amount of state sales tax The total sales tax (county plus state)

Solutions

Expert Solution

CODE: SalesTax.java

import javax.swing.*;
import java.awt.event.*;
class MonthlySalesTax extends JFrame{
   private JPanel panel;
   private JLabel messageLabel_monthlysales;
   private JTextField monthlysalesTextField;
   private JButton saletaxButton;
   private final int WINDOW_WIDTH = 250;
   private final int WINDOW_HEIGHT = 250;
   public MonthlySalesTax(){
       setTitle("Monthly Sales Tax");
       setSize(WINDOW_WIDTH, WINDOW_HEIGHT);
       setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
       buildPanel();
       add(panel);
       setVisible(true);
   }
   private void buildPanel(){
       messageLabel_monthlysales = new JLabel("Enter Total sales for the month ");
       monthlysalesTextField = new JTextField(10);
       saletaxButton = new JButton("Calculate Monthly Sales Tax");
       saletaxButton.addActionListener(new CalculateMST());
       panel = new JPanel();  
       panel.add(messageLabel_monthlysales);
       panel.add(monthlysalesTextField);
       panel.add(saletaxButton);
   }
   public class CalculateMST implements ActionListener{
       public void actionPerformed(ActionEvent e){
           String input;
           double CountyTax;
           double StateTax;
           double TotalsalesTax;
           input = monthlysalesTextField.getText();
           CountyTax = (Double.parseDouble(input)* 0.03);
           StateTax = (Double.parseDouble(input)* 0.05);
           TotalsalesTax = (CountyTax + StateTax);
           JOptionPane.showMessageDialog(null, " The Amount Of County Sales Tax : " + CountyTax + "\n The Amount Of State Sales Tax : "
               + StateTax +   "\n The Total Sales Tax : " + TotalsalesTax );
       }
   }
}
public class SalesTax{
   public static void main(String[] args){
        MonthlySalesTax ST = new MonthlySalesTax();
   }
}

SCREENSHOT OF THE CODE:

OUTPUT:

The total sales for the month i have taken 20000.

5% on The State sales tax is 1000.0 = (5/100)*20000.

3% in County sales tax is 600.0 = (3/100) *20000


Related Solutions

A retail company must file a monthly sales tax report listing the total sales for the month and the amount of state and county sales tax collected.
C programming Monthly Sales Tax Program A retail company must file a monthly sales tax report listing the total sales for the month and the amount of state and county sales tax collected. The state sales tax rate is 4 percent and the county sales tax rate is 2 percent. Write a program that asks the user to enter the total sales for the month. The application should calculate and display the amount of county sales tax, the amount of...
A retail company must file a monthly sales tax report listing the sales for the month and the amount of sales tax collected.
make it in C++ with pointerA retail company must file a monthly sales tax report listing the sales for the month andthe amount of sales tax collected. Write a program that asks for the month, the year,and the total amount collected at the cash register (that is, sales plus sales tax). Assumethe state sales tax is 4 percent and the county sales tax is 2 percent.If the total amount collected is known and the total sales tax is 6 percent,...
A retail company must file a monthly sales tax report listing the sales for the month and the amount of sales tax collected.
Must be done in Visual StudiosA retail company must file a monthly sales tax report listing the sales for the month and the amount of sales tax collected. Write a program that asks for the month, the year, and the total amount collected at the cash register (that is, sales plus sales tax). Assume the state sales tax is 4 percent and the county sales tax is 2 percent.If the total amount collected is known and the total sales tax...
Monthly Sales Tax A retail company must file a monthly sales tax report listing the total...
Monthly Sales Tax A retail company must file a monthly sales tax report listing the total sales for the month, and the amount of state and county sales tax collected. The state sales tax rate is 5 percent and the county sales tax rate is 2.5 percent. Write a Python program with function(s) that asks the user to enter the total sales for the month. Make sure that you do not allow user to enter negative values for the total...
A retail company must file a monthly sales tax report listing the total sales for the...
A retail company must file a monthly sales tax report listing the total sales for the month, and the amount of state and county sales tax collected. The state sales tax rate is 4% and the county sales tax rate is 2%. Create an application that allows the user to enter the total sales from the month. From this figure, the application should calculate and display the following: 1. The amount of country sales tax 2. The amount of state...
Monthly Sales Tax Program A retail company must file a monthly sales tax report listing the...
Monthly Sales Tax Program A retail company must file a monthly sales tax report listing the total sales for the month and the amount of state and county sales tax collected. The state sales tax rate is 4 percent and the county sales tax rate is 2 percent. Write a program that asks the user to enter the total sales for the month. The application should calculate and display the amount of county sales tax, the amount of state sales...
The retail sales tax has become a popular way to finance state, county, and city governments...
The retail sales tax has become a popular way to finance state, county, and city governments as well as special districts. What are the pros and cons of reliance on the retail sales tax as a primary source of revenue, especially for local governments?
Stine Co. is a retail store operating in a state with a 6% retail sales tax.
Stine Co. is a retail store operating in a state with a 6% retail sales tax. The retailer may keep 2% of the sales tax collected. Stine Co. records the sales tax in the Sales account. The amountrecorded in the Sales account during May was $148,400. 99. The amount of sales taxes (to the nearest dollar) for May isa. $8,726. b. $8,400. c. $8,904. d. $9,438.The amount of sales taxes payable (to the nearest dollar) to the state for the...
Vaughn Co. is a retail store operating in a state with a 7% retail sales tax....
Vaughn Co. is a retail store operating in a state with a 7% retail sales tax. The retailer may keep 2% of the sales tax collected. Vaughn Co. records the sales tax in the Sales Revenue account. The amount recorded in the Sales Revenue account during May was $747930. The amount of sales taxes payable (to the nearest dollar) to the state for the month of May is $37307. $47951. $51310. $61874.
Sales tax is collected from buyers and remitted to the government. A retailer has to file...
Sales tax is collected from buyers and remitted to the government. A retailer has to file a monthly sales tax report which lists the sales for the month and the amount of sales tax collected, at both the county and state levels. Develop a program that will input the total collections for a month, calculate the sales tax on the collections, and display the county and state taxes. Assume that states have a 4% sales tax and countries have a...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT