1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
geniusboy [140]
3 years ago
5

This lab requires you to translate your work in the pseudocode and flowchart from Lab 2.2 and Lab 2.3 to actual code using Pytho

n. Read the following program prior to completing the lab.
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 following:
•
The amount of county sales tax
•
The amount of state sales tax
•
The total sales tax (county plus state)

Consider the following functions for your program:
•
main that calls your other functions
•
inputData that will ask for the monthly sales
•
calcCounty that will calculate the county tax
•
calcState that will calculate the state tax
•
calcTotal that will calculate the total tax
•
printData that will display the county tax, the state tax, and the total tax

If your program is correct, sample output might look as follows:

Welcome to the total tax calculator program

Enter the total sales for the month $12567
The county tax is $ 251.34
The state tax is $ 502.68
The total tax is $ 754.02
Computers and Technology
1 answer:
butalik [34]3 years ago
4 0

Answer:

// Scanner class is imported to allow program receive user input

import java.util.Scanner;

// Solution is defined

public class Solution {

   // main method is defined to begin program execution

   public static void main(String args[]) {

    // A welcome message is displayed to user    

    System.out.println("Welcome to the total tax calculator program");

   

   //  inputData is called and assigned to total_sales

    int total_sales = inputData();

   //  calcCounty is called and assigned to county_tax

    double county_tax = calcCounty(total_sales);

   //  calcState is called and assigned to state_tax

    double state_tax = calcState(total_sales);

   //  calcTotal is called and assigned to total_tax

    double total_tax = calcTotal(state_tax, county_tax);

   //  printData is called

    printData(state_tax, county_tax, total_tax);

   }

   

   // The inputData method receive input from user

   // The method returns the received input

   public static int inputData(){

       // A scan object is defined to received input

       Scanner scan = new Scanner(System.in);

       System.out.print("Enter the total sales for the month $");

       int entered_total = scan.nextInt();

       return entered_total;

   }

   

   // The calcCounty method is defined and it

   // return the county_tax

   public static double calcCounty(double total_sales){

       double county_tax = 0.02 * total_sales;

       return county_tax;

   }

   

   // The calcState method is defined and it

   // return the state_tax

   public static double calcState(double total_sales){

       double state_tax = 0.04 * total_sales;

       return state_tax;

   }

   

   // The calcTotal method is defined and it

   // return the total_tax

   public static double calcTotal(double state_tax, double county_tax){

       double total_tax = state_tax + county_tax;

       return total_tax;

   }

   

   // The printData method print out the data

  // Each data is displayed to 2 decimal place

   public static void printData(double state_tax, double county_tax, double total_tax){

       System.out.println("The county tax is $" + String.format("%.2f", county_tax));

       System.out.println("The state tax is $" + String.format("%.2f", state_tax));

       System.out.println("The total tax is $" + String.format("%.2f", total_tax));

   }

}

Explanation:

You might be interested in
TQ Sustainability & Technology
harkovskaia [24]

A way to make the metro system more sustainable is to use machine learning so as to optimize the frequency of train routes  using passenger load.

<h3>What is a sustainable transport system?</h3>

This sustainable transport system is known to be a kind of system that aids the basic access and growth needs of the society to be met rightly and safely.

This also should be meant in a way that is consistent with human and ecosystem health, and boast equity in all successive generations.

Other methods are the use of Cooling System to lower temperature and non waste of Energy and also lower the Noise Levels.

learn more about Sustainability from

brainly.com/question/25032305

4 0
3 years ago
Tax that you pay when making a profit from selling a house is an example of:
spayn [35]
B lol its the only one that makes since all though im not sure if im exactly right 
4 0
3 years ago
Which studio produced the film The Jazz Singer, the first of many “talkies”?
olga nikolaevna [1]
Warner Brother produced the Jazz Singer. 
8 0
3 years ago
If you have long column labels with columns so wide that they affect the readability of a worksheet, you should first
Alla [95]
The answer is (C) consider how you could shorten the column labels.

The label at the top of a column is sometimes wider than the data stored in the column. Expanding a column is an option but this may mean that you will not see as many columns on a page as possible. Wrapping text is also an option but has a downside to it as well since it will make the row with great height. 

Rotating the labels is also a possibility but is also not recommended. This leaves us with shortening the column labels and keep dictionary worksheet for users. As much as you can, consider using acronyms and abbreviations.






6 0
3 years ago
Read 2 more answers
True or False: VLANs in cloud computing are most likely to be found on direct connections with a CSP.
elena-14-01-66 [18.8K]

Based on computing network operation, it is <u>false</u> that VLANs in cloud computing are most likely to be found on direct connections with a CSP.

<h3>What is VLAN?</h3>

VLAN is an acronym of Virtual Local Area Network that establishes its broadcast domain which enables network admins to combine hosts regardless the hosts are connected on the same network switch or not.

Given that the VLAN created its broadcast domain, you are likely not found it on direct connections with a CSP.

Hence, in this case, it is concluded that the correct answer is False.

Learn more about VLAN here: brainly.com/question/6769174

8 0
2 years ago
Other questions:
  • 52.
    11·1 answer
  • You wish to share cases created and owned by your community users (Customer Community Plus) with the internal product support te
    15·1 answer
  • What is the name used for the camera s view from a single position?
    9·1 answer
  • Please check my answer! (Java)
    8·1 answer
  • Blank determines the overall brightness or darkness of an entire image
    5·1 answer
  • #include #include int main( ) { int value = 10; int pid; value += 5; pid = fork( ); if (pid &gt; 0 ) { value += 20; } printf(val
    10·1 answer
  • What is an example of CT SO?
    9·1 answer
  • If the disaster requires actions offsite from the primary infrastructure, it is under the jurisdiction of__________.
    7·1 answer
  • Content area a leased asset will appear on the balance sheet as a long-term asset. true false'
    5·1 answer
  • a company recently implemented a secure sockets layer/transport layer security (ssl/tls) version that supports secure hashing al
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!