Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In python 3, please. 2.6 Program: Checkout System This assignment requires you to build a simple checkout system. The requirements are: (1) Build an Item

In python 3, please. image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
2.6 Program: Checkout System This assignment requires you to build a simple checkout system. The requirements are: (1) Build an Item class with the following specifications: Attributes (2 pts) item_name (string) . item price (float) item_quantity (int) (2) Add a default constructor to the item class. The constructor should Initialize the item's name = "Empty", item's price =0.0, item's quantity = 0.(1 pt) (3) Add a method to item called print_item_cost that prints the item name, the item quantity, the unit price and total price for this item. The prices should have two decimal points (1 pt) Example of the printitem_cost() output: Bottled Water 10.00 @ $1 - $10.00 (4) Build a Checkout class with the following data attributes and related methods. (2 pts) Constructor which takes the customer name and date as parameters Attributes customer_name (string) - Initialized in default constructor to 'None date (string) - Initialized in default constructor to January 1, 1970 cart_items (list) Methods add item() Adds an item to cart_items list. Takes item as a parameter. Does not return anything. remove item remove_item Removes item from cart_items list. Takes a string (an item's name) as a parameter. Does not return anything. If item name cannot be found output this message: Item not found. No changes. modify_item Modifies an item's quantity. Has parameter item. Does not return anything. If item can be found (by name) in the list, modify item in cart. If item cannot be found (by name) in cart, output this message Item not found. No changes. (5) in the main section of your program, prompt the user for a customer's name and today's date. Create an object of type Checkout. Create a function call print_cart() that rakes the Checkout instance as a parameter and prints the information in Checkout (it will have no items at this point) (2 pts) Example output Enter customer's name: Chauncey C Enter today's date: March 3, 2020 CART: Customer name: Chauncey C Today's date: March 3, 2020 (6) In the main section of your code, output a menu of options to manipulate the shopping cart. Each option is represented by a single character. Buld and output the menu within the function If the an invalid character is entered, continue to promot for a valid choice. Call print menu) in the main function. Continue to execute call print menul until the user enters to Quit. (3 pts) Example output Example output Enter customer's name: Chauncey C Enter today's date: March 3, 2020 CART: Customer name: Chauncey C Today's date: March 3, 2020 Total: $0.00 MENU a - Add item to cart r - Remove item from cart - Change item quantity 9 - Quit Choose an option: (7) Implement Add item to cart menu option. (3 pts) Example of output Example of output Enter customer's name: Chauncey C Enter today's date: March 3, 2020 CART: Customer name: Chauncey C Today's date: March 3, 2020 MENU a - Add item to cart r - Remove item from cart C - Change item quantity 9 - Quit Choose an option: a ADD ITEM TO CART Enter the item name: Running shoes Enter the price: Enter the quantity: CART: Customer name: Chauncey C Today's date: March 3, 2020 CART: Customer name: Chauncey C Today's date: March 3, 2020 Running Shoes 2 @ $97.00 = $194.00 Total: $199.00 (8) Implement remove item menu option. (3 pts) Example of output Enter customer's name: Chauncey C. Enter today's date: March 3, 2020 CART: Customer name: Chauncey C Today's date: March 3, 2020 Total: $0.00 MENU a - Add item to cart r - Remove item from cart C- Change item quantity 9 - Quit Choose an option: a Choose an option: a ADD ITEM TO CART Enter the item name: Laptop Enter the price: 499 Enter the quantity: CART: Customer name: Chauncey C Today's date: March 3, 2020 Laptop 1 @ $499.00 - $499.00 Total: $499.00 MENU a - Add item to cart r - Remove item from cart C- Change item quantity 9 - Quit Choose an option: r REMOVE ITEM FROM CART Enter name of item to remove: Laptop CART: Customer name: Chauncey C CART: Customer name: Chauncey C Today's date: March 3, 2020 Total: $0.00 (9) Implement Change item quantity menu option. (3 pts) Example of output Enter customer's name: Chauncey C Enter today's date: March 3, 2020 CART: Customer name: Chauncey C Today's date: March 3, 2020 Total: 50.00 MENU a - Add item to cart - Remove item from cart C - Change item quantity q - Quit Choose an option: a Choose an option: a ADD ITEM TO CART Enter the item name: Skateboard Enter the price: 109 Enter the quantity: CART: Customer name: Chauncey C Today's date: March 3, 2020 Skateboard 1 @ $109.00 - $109.00 Total: $109.00 MENU a - Add item to cart - Remove item from cart C - Change item quantity q - Quit Choose an option: CHANGE ITEM QUANTITY Enter the item name: Skateboard Enter the new quantity: CART: Choose an option: C CHANGE ITEM QUANTITY Enter the item name: Skateboard Enter the new quantity: CART: Customer name: Chauncey C Today's date: March 3, 2020 Skateboard 3 @ $109.00 - $327.00 Total: $327.00

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

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

Recommended Textbook for

Murach's SQL Server 2012 For Developers

Authors: Bryan Syverson, Joel Murach, Mike Murach

1st Edition

1890774693, 9781890774691

More Books

Students also viewed these Databases questions

Question

Explain the process of MBO

Answered: 1 week ago