MAKE FLOWCHART TO GO ALONG WITH IT  FLOWCHART EXAMPLE PROVIDED AS WELL AS MY CODE

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter15: Recursion
Section: Chapter Questions
Problem 6PE
icon
Related questions
Question

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):
Transcribed Image Text: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):
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Concept of Flowchart
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr