Coder Social home page Coder Social logo

enganwaralkhteeb / coffee-machine-with-using-oop Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 79 KB

Coffee-making with this Python program that simulates a coffee machine using Object-Oriented Programming

Home Page: https://replit.com/@ANWERALKHTEEB/Coffee-Machine?v=1

Python 100.00%
100dayofpython coffee-machine coffee-maker coffeemaker oriented-object-programming

coffee-machine-with-using-oop's Introduction

โ˜• Coffee Machine Simulator

A Python program that simulates a coffee machine using Object-Oriented Programming (OOP) principles. The program consists of different classes for modeling the coffee maker, menu items, and money handling.

๐Ÿš€ Features

  1. CoffeeMaker Class: Models the coffee machine that makes the coffee. Handles resources, reports, and coffee-making functionality.

  2. Menu Class: Models the menu with different drink options. Includes a class for each menu item with specific ingredients and costs.

  3. MoneyMachine Class: Models the money-handling functionality. Processes coins, makes payments, and keeps track of profits.

  4. Main Program (main.py): Integrates the classes to create an interactive coffee machine experience. Allows users to order coffee, turn off the machine, and generate reports.

๐Ÿ“‚ Project Structure

  • coffee_maker.py: Models the CoffeeMaker class.
  • menu.py: Models the Menu and MenuItem classes.
  • money_machine.py: Models the MoneyMachine class.
  • main.py: Main program that utilizes the classes for a complete coffee machine simulation.

โš™๏ธ Usage

  1. Run the main.py file in a console or terminal.
  2. Follow the prompts to order coffee, turn off the machine, generate reports, and more.
  3. Experience a virtual coffee-making adventure!

๐ŸŒ Example

#
from menu import Menu, MenuItem
from coffee_maker import CoffeeMaker
from money_machine import MoneyMachine

money_machine = MoneyMachine()
coffee_maker = CoffeeMaker()
coffee_maker.report()
money_machine.report()
menu = Menu()
is_on = True

while is_on:
    options = menu.get_items()
    choice = input(f"What would you like? ({options}): ")
    if choice == 'off':
        is_on = False
    elif choice == 'report':
        coffee_maker.report()
        money_machine.report()
    else:
        drink = menu.find_drink(choice)
        if coffee_maker.is_resource_sufficient(drink) and money_machine.make_payment(drink.cost):
            coffee_maker.make_coffee(drink)

coffee-machine-with-using-oop's People

Contributors

enganwaralkhteeb avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.