Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem Statement: Mini book store In this assignment, you will write a simple python application to simulate a mini book shop check out system. The

image text in transcribed

Problem Statement: Mini book store In this assignment, you will write a simple python application to simulate a mini book shop check out system. The purpose of this assignment is to gain experience in python's for loop and sequence. This will also help you with your on-going homework assignment. Lab Scenario: 1. You are given a list containing the title and price of the book. The list named books is provided in the template file. 2. User will first be prompted to enter the number of the book s/he wants to add to the cart. Let's say the name of the variable is total_count (given in the template file) 3. A while loop will run through the program total_count number of times to add the required number of books to user checklist. 4. User will be displayed with the books list and then prompt to enter the title of the book for purchasing. Hint: How to convert a list to a string for nice display? 5. The list is defined as follows: a. Each item of the list is a string. b. Title of the book and price are separated by a colon (':'). c. You need to separate the title and the price of the book by (':'). Hint: Remember how you split a string? 6. You are expected to use for loop to iterate through each item in the list, separate the title and price. The program will match the user input with the title in the list. 7. If the user input matches with one of the titles in books list then that item will be added to user checklist. Otherwise, no book will be added. Hint: Use a comparison operator to see if the user input matches with any title in the books list. 8. For this lab, the program needs to be case sensitive. For example: user can enter the name in all lowercase but the program will still find the name of the book if present in the list. Hint: string.lower() and string.upper() are two methods that can be used. 9. Test the application by considering some possible I/O

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

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

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

Databases And Python Programming MySQL MongoDB OOP And Tkinter

Authors: R. PANNEERSELVAM

1st Edition

9357011331, 978-9357011334

More Books

Students also viewed these Databases questions