Question

In: Computer Science

Monthly Sales Tax A retail company must file a monthly sales tax report listing the total...

  1. 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 sales (that is validate with a loop). From the entered total sales amount, your program 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)

    • Note: Your program should have multiple functions.
  2. Falling Distance

    When an object is falling because of gravity, the following formula can be used to determine the distance the object falls in a specific time period:

    [Math Processing Error]distance=12gt2

    The variables in the formula are as follows: d is the distance in meters, g is 9.8, and t is the amount of time, in seconds, that the object has been falling.

    Write a function named falling_distance (in Python) that accepts an object’s falling time (in seconds) as an argument. The function should return the distance, in meters, that the object has fallen during that time interval. Write a Python program (main function) that calls the falling_distance function in a loop that passes the values 1 through 10 as arguments and displays the return value for each iteration.

Solutions

Expert Solution

  • Provided programs are well commented for better understanding.
  • Code snippets are provided below the typed code.
  • Please refer to snippet of code to understand the indentation of code.
  • Output snippet are also attached.

Monthly Sales Tax:

Program:

# defining function to calculate state sales tax
def state_sales_tax(n):
    # returning 5% sales tax
    return n*0.05


# defining function to calculate country sales tax
def country_sales_tax(n):
    # returning 2.5 % tax
    return n*0.025


# defining function to return total sales tax
def total_sales_tax(n):
    # returning states tax + country tax
    return state_sales_tax(n) + country_sales_tax(n)


# defining main function
if __name__ == '__main__':
    # asking for input and validating input using while loop
    total_sales = float(input("Enter total sales for the the month: "))
    # validating user input with loop for negative values
    while total_sales < 0:
        print("Invalid input!")
        total_sales = float(input("Enter total sales for the the month: "))
    # printing values
    print('The amount of county sales tax: ', country_sales_tax(total_sales))
    print('The amount of state sales tax', state_sales_tax(total_sales))
    print('The total sales tax (county plus state)', total_sales_tax(total_sales))

Code Snippet:

Output #1:

Output #2:

Output #3:

Falling Distance:

Program:

# defining falling_distance function
def falling_distance(t):
    # variable g with 9.8 as value
    g = 9.8
    # computing value of d and rounding it
    d = round((1/2)*g*(t*t), 2)
    # returning computed value of d
    return d


# defining main function
if __name__ == '__main__':
    # loop for 1 to 10
    for i in range(1, 11):
        # print returned value
        print(falling_distance(i))

Code Snippet:

Output Snippet:

I hope you got the provided solution.

Thank You.


Related Solutions

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...
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...
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...
Winfield Company operates a retail store a) Below is a table containing monthly sales and sales...
Winfield Company operates a retail store a) Below is a table containing monthly sales and sales staff compensation, in dollars for the previous year. Use the high-low method to create an equation in the form Y = a+ bX to describe the behavior of sales staff compensation. Month Comp Sales 1 412,700 1,808,000 2 386,000 1,659,000 3 359,700 1,512,000 4 346,500 1,138,000 5 359,400 1,218,900 6 341,000 1,233,000 7 366,500 1,409,300 8 364,200 1,437,000 9 400,100 1,616,600 10 443,000 1,833,000...
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.
A retail sales tax on remote sellers will produce as much revenue as a use tax...
A retail sales tax on remote sellers will produce as much revenue as a use tax on in-state purchasers. T/F
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT