Question: How should the program work? Instructions are provided below Books and their corresponding costs are shown in the image below.Create the lists above BEFORE the
How should the program work? Instructions are provided below
Books and their corresponding costs are shown in the image below.Create the lists above BEFORE the main function, doing this would give all the functions you create access to these lists.Notice that the lists above reference the same number of elements. "authors" list, and was published in again the first element in the "published" list, and costs $ which is also the first element in the "prices" list Next Create the functions defined in the table shown below
tableFunctionDescription,Input Argument,Return ResultsbookdisplaytableDisplays all theinformation for allthe books in atabular formattableDoesnt need to takearguments if lists arecreated before themain functionDoesn't return valuesshowpurchasebooknumstableDisplays informationfor the books theuser wants to buytablebooknums is a listthat references theindex positions forthe books the userwant to purchaseDoesn't return valuestotalsbooknumstableGets prices for booksthe user chose tobuy It thencalculates thefollowing Total pricesfor all thebooks chosen Tax totalprice Final totaltotal price taxtablebooknums is a listthat references theindex positions forthe books the userwant to purchasetableReturns three values costsum ofbook prices tax totalsum ofprices tax
Create a main function. The first thing the main function will do is call the bookdisplay function.
Below is a screenshot that shows what the bookdisplay function would display Next the program is to ask the user if they wish to purchase another book. If they do the program is to ask the user to enter the number for the next book they want to purchase.
Next the program is to call the totalsbooknums function then display the resutls.
The image below provides an example of what the output should look like
Enter number of book you want to buy:
Would you like to purchase another book? y for yes :y
Enter number of book you want to buy:
Would you like to purchase another book? y for yes :n
PricePython Help
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
