MAKE FLOWCHART TO GO ALONG WITH IT FLOWCHART EXAMPLE PROVIDED AS WELL AS MY CODE
PYTHON PROGRAMMING ONLY
NEED HELP MAKING A FLOWCHART TO GO ALONG WITH MY CODE
MY CODE IS ALREADY DONE AND CORRECT JUST NEED TO MAKE FLOWCHART TO GO ALONG WITH IT
FLOWCHART EXAMPLE PROVIDED AS WELL AS MY CODE
QUESTION:
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 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)
MY CODE:
# Function to validate input as a positive float
def get_valid_float(prompt):
while True:
try:
value = float(input(prompt))
if value >= 0:
return value
else:
print("Please enter a positive value.")
except ValueError:
print("Invalid input. Please enter a valid number.")
# Constants for tax rates
STATE_TAX_RATE = 0.05
COUNTY_TAX_RATE = 0.025
# Get the total sales from the user
total_sales = get_valid_float("Enter the total sales for the month: $")
# Calculate the county and state sales tax
county_sales_tax = total_sales * COUNTY_TAX_RATE
state_sales_tax = total_sales * STATE_TAX_RATE
# Calculate the total sales tax
total_sales_tax = county_sales_tax + state_sales_tax
# Display the results
print(f"County Sales Tax: ${county_sales_tax:.2f}")
print(f"State Sales Tax: ${state_sales_tax:.2f}")
print(f"Total Sales Tax: ${total_sales_tax:.2f}")
![Function Returning Boolean Values
Continuous Summing Function Example Flowchart:
get and check
positive integer
(prompt)
check continue
(prompt)
while True
Return True
Return False
True
True
True
Print invalid
input
Get input
text
False
if text is
"no"
False
while True
Return intinum)
True
Print invalid
input
True
Get input
numeric
and>0/False
Start main
sum=0
cont-True
PUDO
while cont
False
Print sum
End main
True
get and check
positive integer
Enter a number:
sum + num
cont=
check continue" Add
Another? (yes/ho):](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F7cef3050-b0aa-40af-9112-57cab04a18ba%2F846f2f2c-44ba-42dc-8577-34bf61b9bef3%2Ft0753jd_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![C++ Programming: From Problem Analysis to Program…](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)
![C++ for Engineers and Scientists](https://www.bartleby.com/isbn_cover_images/9781133187844/9781133187844_smallCoverImage.gif)
![C++ Programming: From Problem Analysis to Program…](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)
![C++ for Engineers and Scientists](https://www.bartleby.com/isbn_cover_images/9781133187844/9781133187844_smallCoverImage.gif)