Python Forum
Need some beginner Module help...
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need some beginner Module help...
#1
Just started Intro to Programming Logic and am having a little trouble understanding modules. Here is the instructional video https://www.youtube.com/watch?time_conti...CZqQ6xEzoY, and I have read up on functions, calling, and returning. Just still a little confused on how to turn this

# Declare Real purchase
#
# Display "Please enter the amount of your purchase."
# Input purchase
# Declare Real state_sales_tax
# Declare Real county_sales_tax
# Declare Real total_after_state_sales_tax
# Declare Real total_after_county_sales_tax
# Declare Real full_amount
#
# Set state_sales_tax = 0.04
# Set county_sales_tax = 0.02
# Set total_after_state_sales_tax = state_sales_tax * purchase
# Set total_after_county_sales_tax = county_sales_tax * purchase
# Set full_amount = total_after_state_sales_tax + total_after_county_sales_tax + purchase
# Display "State tax adds", total_after_state_sales_tax, "to your original purchase of", purchase,
# Display "and county tax adds", total_after_county_sales_tax, "which comes to a grand total of", full_amount

purchase = int(input("Please enter the amount of your purchase."))
state_sales_tax = 0.04
county_sales_tax = 0.02
total_after_state_sales_tax = state_sales_tax * purchase
total_after_county_sales_tax = county_sales_tax * purchase
full_amount = total_after_state_sales_tax + total_after_county_sales_tax + purchase

print("State tax adds", total_after_state_sales_tax, "to your original purchase of", purchase,
"and county tax adds", total_after_county_sales_tax, "which comes to a grand total of", full_amount)
into a modular form. Please help!
Reply


Messages In This Thread
Need some beginner Module help... - by Alimdor - Jan-26-2018, 09:06 PM
RE: Need some beginner Module help... - by Alimdor - Jan-27-2018, 04:05 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020