Question
in PYTHON -should look like attached PHOTO
-A retail company must file a monthly sales tax report listing the total sales for the month and the amount of state and federal sales tax collected.

-The Company made $1000 in sales in month 1.
-Sales increased by 10% from the previous month each month for 6 months except in month 5 where it increased only 7%. (i.e. From month 5 to month 6 there was only a 7% increase)

-State tax rate is 5 percent and the Federal tax rate is 2.5 percent.

-Write code that utilizes a while loop to display the amount of sales and tax collected in each of the six month as shown on slide 3.

should look like attached photo at the end

MONTH MONTHLY SALES $1,000.00 $1,100.00 $1,210.00 $1,331.00 $1,464.10 $1,566.59 STATE TAX AMOUNT $50.00 $55.00 $60.50 $66.55
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Here is the program for your description in Python Programming Language.

Note : Please follow the indentations as shown in the screenshots if missed the same in pasting the code. If you copy the code below please check it in a black background editor as there occurs unnecessary dots in the middle of the code that causes trouble in compilation.

CODE :

#Initialising sales to 1000

sales = 1000

#initialising i to 1

i = 1

#Printing the header

print("MONTH\tMONTHLY SALES\tSTATE TAX AMOUNT\tFED TAX AMOUNT\tTOTAL TAX AMOUNT\tSALES-TAX")

while(i<=6):

                #calculating stateTx , fedTax and salesTax

    stateTax = sales*0.05

    fedTax = sales*0.025

    salesTax = sales - (stateTax + fedTax)

    #printing the values in required format

    #To provide specific spaces between words use "<" - to print after word

    #Use ">" - to print before word and specify number of spaces from starting letter of current

    #word to next word

    #Example - {1:<15.2f} says to print 15 spaces after first argument and restrict to two floating points

    print("{0:<8}${1:<15.2f}${2:<23.2f}${3:<15.2f}${4:<23.2f}${5:0.2f}".format(i,sales,stateTax,fedTax,(stateTax + fedTax),salesTax))

    #if the month is 5th then sales will be increased only by 7%

    if(i == 5):

        sales = sales + sales*0.07

    #Otherwise sales will be increases by 10%

    else:

        sales = sales + sales*0.1

    #inrementing i value by 1

    i = i +1

SREENSHOTS :

Please see the screenshots of the code below for indentations.

1 #Intialising sales to 1000 2 sales = 1000 3 #initialising i to 1 4 i = 1 5 #Printing the header 6 print(MONTH\tMONTHLY SAL

OUTPUT:

$python main.py MONTH MONTHLY SALES $1000.00 $1100.00 $1210.00 $1331.00 $1464.10 $1566.59 STATE TAX AMOUNT $50.00 $55.00 $60.

Any doubts regarding this can be explained with pleasure:)

Add a comment
Know the answer?
Add Answer to:
in PYTHON -should look like attached PHOTO -A retail company must file a monthly sales tax...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Help with a Python programming problem, i got the first problem correct but cant seem to...

    Help with a Python programming problem, i got the first problem correct but cant seem to get this one. TASK 2: A retail company must file a monthly sales tax report listing the total sales for the month and the amount of state and federal sales tax collected. The Company made $1000 in sales in month 1. Sales increased by 10% from the previous month each month for 6 months except in month 5 where it increased only 7%. (i.e....

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT