Skip to content

curpe/cashier-machine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 

Repository files navigation

A guide to Python simple cashier-machine 🚀

  • Trying my best to make the code as intuitive as i can
  • This code was made back in 2023

Objective Notes

Cashier Machine is a program designed to make it easier for customers to add items to a cart. Within this object, customers can view the items they have added, modify those items, specify quantities, and calculate the total price. This allows customers to complete their payment based on the logic built into the system.

Methodology and concept applied on this project

  • Object Oriented Programming (OOP)
  • Error Handling
  • Docstring
  • Composite Data Structure
  • Looping and Branching

Objective

  • Customer create Transaction with Methods.
  • Customer can Add Item, Add Quanitity, and Add Price to each item.
  • After adding item,quantity, and price, they can update to each one of the function.
  • Customer can remove particular item of they own.
  • Customer can do reset the item of the entire basket.
  • Add discount logics if the total price were sufficient.

The Diagram Journey (old version)

python_cashier_project drawio

Test this code in your IDE.

    1. Clone this repository.
    1. After the code appears on your IDE, Open your terminal.
    1. Type this in your terminal:
    python menu.py
    
    1. And you will see this when the code running.
    Initialization

Test case and result

  1. Method add_barang() with the customer can freely input their items. add

  2. Method delete_item() particular items after they added the item by themselves. delete

  3. Method update_nama_item() to update "Kentang" to "Kentung". edit_name

  4. Method update_jumlah_item() to update the quantity of particular item. edit_quantity

  5. Method update_harga_item() to update the price of particular item. edit_price

  6. Method check_order() see the entire item that were inputted. show_basket

  7. Method total_pembelian() + discount_inputted() to check the total price, total quantity, total type of item and see if the price were match with discount scheme. see_transaction

  8. Make a simple payment transaction on pembayaran() method.

    • If the nominal below than the total price, you will see this: transaction_handling

    • Say YES if you want to try again, check the order and the item is still there: check_order_after_yes

    • Input the nominal match with total sesuai harga and you will see this message: transaction_success

    • If you input "YES", then items in the basket will removed. basket_empty

  9. After all, you can reset the entire basket by reset_item() method. reset_basket

  10. exit the PACSHIER system by pressing no 9 on your terminal. exit

Conclusion and Suggestion

  • Kita bisa menambah Library seperti table agar lebih rapih.
  • Masih perlu banyak improvement dan exploration dalam code.
  • Diagram masih belum di update dengan code yang terbaru, tetapi secara garis besar code structure nya mendekati dengan diagram nya.

Hope this helps 😊

Copyright (c) 2023 Abhi Abduh

About

Building cashier program with Python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages