INFO 101 Homework 1
Fall 2018
SALES TAX
Regular 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 5 percent and the county sales tax rate is 2.5 percent. Write a program that asks the user to enter the total sales for the month. From this figure, the program should calculate and display the following:
- The amount of the county sales tax
- The amount of the state sales tax
- The total sales tax (county plus state)
Each calculation must be in a separate function. The program should have five functions total:
- Main
- County tax
- State tax
- Total tax
- Display the results
- If you wanted to make a sixth function, you could put the introduction to the program there. Otherwise, you can put it in main().
Bonus Program
The tax rate in the west side of the county is 2.5 percent. The rate in the east side is 3.5 percent. Ask the user which side he or she lives on and calculate the tax accordingly. The bonus is worth up to 6 points: 3 for the correct answer and 3 for no errors.
Requirements:
- A comment header at the beginning of the program
- Numerous comments throughout the code
- Descriptions that print on the screen telling the user about the program
- Descriptions about the results
- Use variables to represent the data
- If errors occur from entering invalid data, the program should handle those errors.
- Make the program continuous. Don’t let the program end until valid results have been calculated.
- Turn in a hard copy of your code.
This assignment is due at 11:59 pm, on Friday, September 21. Upload it to the D2L Dropbox. A penalty of 3 points per day will be assessed for each day the assignment is late (with a maximum of 15 points).
Dislaimer: every effort has been made to insure an accurate set of instructions. Should any changes be needed, I will provide an updated assignment in D2L.
Here is sample output for the regular program:
The Frame Gallery’s state and county sales taxes are due.
Enter the total sales for the month: q
Please enter a valid sales amount.
Enter the total sales for the month: 1000
State Tax: $50.00
County Tax: $25.00
Total Tax: $75.00
Here is sample output for the bonus program:
The Frame Gallery’s state and county sales taxes are due.
Enter the total sales for the month: 100
Which side of the county do you live in? West
State Tax: $5.00
County Tax: $2.50
Total Tax: $7.50
The Frame Gallery’s state and county sales taxes are due.
Enter the total sales for the month: 100
Which side of the county do you live in? East
State Tax: $5.00
County Tax: $3.50
Total Tax: $8.50
Here is the rubric:
HOMEWORK 2 — SALES TAX | |
CONTENT | |
Did you use functions? | |
main (5) | 10 |
state tax (10) | 10 |
county tax (10) | 10 |
total tax (10) | 10 |
display results (10) | 10 |
Are the calculations correct? | |
State tax (10) | 10 |
County tax (10) | 10 |
Total tax (10) | 10 |
Did you use variables instead of | |
‘real’ numbers? | |
Yes (10) | 10 |
Are errors handled? | |
Errors max 5 @ 10 (50) | 50 |
Have you made comments? | |
Header (5) | 5 |
In-code (10) | 10 |
Is there a printed description of | |
the program? | |
Yes (5) | 5 |
Is there a printed description of | |
the results? | |
Yes (5) | 5 |
Anything else not in the previous sections | |
Miscellaneous (20) | 20 |
FORMATTING | |
Is the code neatly written? | |
Yes (5) | 5 |
Are the results neatly displayed? | |
Yes (5) | 5 |