Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Good afternoon. How do I write the following requirements in python code? I would like to have this as an example so I have more

Good afternoon. How do I write the following requirements in python code? I would like to have this as an example so I have more knowledge on how to create functions. Where possible use classes. It would be really helpful if you could comment the code so I have a better understanding of what is being done. Thank you in advance.

Shopping basket:

this feature should display/update the product name, its price and the quantity required, and any discount that applies to the purchase. The price needs to be updated depending on the quantity required. Discount may be applied at checkout-if any are applicable, clearly indicate to the user that "discounts will be applied at check-out".

  • add products to shopping basket;
  • update shopping basket
  • delete items from the shopping basket.

Check-out:

  • display delivery options and allow the user to select one or to use a default option;
  • apply any applicable discount scheme and update the total sales price;
  • calculate delivery cost and update the total sales price.

Payment:

  • allow the user to enter payment details;
  • verify payment using a simple VISACheck emulator as described in the system specifications above;
  • store the sales transaction and delivery details on your database;
  • for each product purchased, update the remaining stock quantity on your database.

Generate sales receipt:

  • display the receipt in an appropriate GUI;
  • allow the user to save the receipt to a file for printing.

On check-out, customers should be given different delivery options including collection in- store and should determine delivery rates based on the option chosen. All online payments will be by credit card and will be verified through VISACheck. Your prototype system only needs to emulate VISACheck by simply creating a function that assumes that all payments are verified. After the payment is processed, the system should produce a receipt with a breakdown of the items purchased including any discounts applied, the delivery method and cost, and the total amount paid. The system should update stock after each payment is complete. The online catalogue must clearly indicate to the customer those products that are out of stock.

The system needs to allow for discount schemes to encourage sales. The discount schemes should offer discounts such as weekend special offers (10% discount) or BOGOF (Buy one get one free) for limited edition toys.

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

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

More Books

Students also viewed these Programming questions

Question

Why does Justice Harlan think the decision will be pernicious

Answered: 1 week ago