Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Used Books. The progran outputs the total cost before tax, the sales and the total after tax. Global Constants - Use these in your progran

image text in transcribed
image text in transcribed
Used Books. The progran outputs the total cost before tax, the sales and the total after tax. Global Constants - Use these in your progran where it makes sense \( X_{\text {_RATE }}=0.06 \) A 6X sales tax MAX =4 CCOST =8,58 3_MAX =10 __COST =24.00 AG_MAX =25 A6cosT=5.95 The get_iten_count function takes one paraneter: nax_alloned - Maxinum number of items the user can enter This function will ask the user to enter the number of itens and validate the number entered is between 0 and the max_allowed inclusive. The nunber of itens the user enters is returned, at got ites count (): I You should fill in the paraseters needed mbooks = float (input ('Inten the nusber of itens: ")) white mbooks - B or wooks >48 : print ('Nubber of items sust be between a and 40.19 ) mbooks = float(input('Enter the nuaber of itess: ')) pass " Replace pass with your inplesentation The get_iten_total function takes two paraseters: num_itens - Nusber of itens unit_price - The cost of each itea This function calculates the total cost for the iteas and returns that value. ast ites total(): \# You should till in the parageters needed pass \# Replace pass with your inplementation The cate_and_display_receipt function witl calcutate alt the necessary vatues and display the receipt. It takes three paraneters: b_total - Total cost of workbooks to total - Total cost of textbooks a total . Tetal enst af manazinns 0 Temine 0 sevicu \# necessary values and display the feceipt. It takes three parame * wb_total - Total cost of workbooks A tb_total - Total cost of textbooks \# Ti.total - Total cost of magazines \# This function will calculate total before tax, the tax on the \# and the total after tax is added. \# \# The receipt should display the total cost of norkbooks, textboo \# magazines If the iten cost is greater than 8 . The receipt shoul an include the subtotal, tax, and total. bef calc-and dfsplay neceipt(): \# You should fill in the paramet pass, \# Replace pass with your implementation \# main function - DO NDT MAKE ANY CHANGES TO CODE BELOF THIS LIME Pdef math 0 : print( 'Workbooks') wb_iten_count = get itea count ( in in mb_total = getitem total ( bitis count, in onst ). print('Textbooks') tb item count = qet iter count ( Bidax) print ( Mogazines') E_iton_count = get item_-count (4A3 HAX ). motal = get item total ( it ites-count WAD-Gast) calc_and_display_neceipt(wb_totol, * Call the main function. main()

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions