0% found this document useful (0 votes)
33 views

Beginner Python POC

This document outlines two Python object-oriented programming examples: an online food delivery system and a car rental service called Zoom Car Rent. For the food delivery system, it describes creating a class with food categories and items, methods to display prices and apply discounts, and methods to add items to a cart and process purchases. For the car rental service, it involves creating a ZoomCarRent class with car categories and numbers, methods to display prices and apply seller discounts, and a method to book rides that calculates prices based on hours and car type. Both examples specify coding conventions like exception handling and naming.

Uploaded by

Aravind RB
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views

Beginner Python POC

This document outlines two Python object-oriented programming examples: an online food delivery system and a car rental service called Zoom Car Rent. For the food delivery system, it describes creating a class with food categories and items, methods to display prices and apply discounts, and methods to add items to a cart and process purchases. For the car rental service, it involves creating a ZoomCarRent class with car categories and numbers, methods to display prices and apply seller discounts, and a method to book rides that calculates prices based on hours and car type. Both examples specify coding conventions like exception handling and naming.

Uploaded by

Aravind RB
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Python POC on OOPS (classes function and data structure)

 Online Food Delivery

Step 1 : Create class and methods based on food delivery item


Step 2 : Food category - there should be food category (North Indian , South Indian, Italian,
Chinese, Continental) each food category should at least have 5 food items.
Step 3: Constructor - class constructor should show available food items based on category
Step 4 : Price method - a method that should show price of available items
Step 5: Discount method - give 10 percent discount on each category food by applying promo
code = "pythonlearner"
this method should ask for promo code and show the discounted price based on each category
Step 6: Add to cart method - write a method that should add your given food item to cart,
display a message.
Step 7: Buy now method - this method should ask a user to enter food name and price and
based on these parameters, method should decide whether you can buy the food or not if
amount is less than the decided food price it should display message accordingly.
On successful buy user also should get message that order "successfully purchased and will be
delivered"

Coding convention:
1. All the methods should have exception handling
2. Class name should follow camel case and method name should be in snakecase
3. Write a code in vs code and create a python file as a package and use it by importing in
another folder by creating another python file
4. Write simple use cases to test various orders and provide the answers.
 Zoom car rent

A zoom car use case based on python OOPS.


Step 1: Write a class named ZoomCarRent
Step2: List the numbers of cars available based on category(Micro,Sedan, SUV , luxury_car)
Each category should have atleast 5 cars
Micro – Alto
Sedan – Honda City
SUV - Fortuner
Luxury Car – Jaquar
Step 3: Price - write a method and Display the car price on the basis of category
Step 4: Seller discount - write a method that will five 10 percent discount by applying "seller10"
promo code.
The method should ask to enter promo code if correct then show discounted price else show
the normal price
Step 5: Bookride - Book a ride method that should ask for price, car name , hours to ride , and
give a successful booking , this method should also decide based on hours the price will be
decided on the basis of hours.
Micro : Per hour amount should be 100 rs
Sedan: Per hour amount should be 150 rs
SUV: Per hour amount should be 200 rs
Luxury Car: Per hour amount should be 300 rs
Step 6: seller class - In case of any damage user should pay the full amount of damage, write
this method and use this method inside bookride method while booking a ride user should get
this message
Coding convention:
1. All the methods should have exception handling
2. Class name should follow camel case and method name should be in snake case
3. Write a code in vs code and create a python file as a package and use it by importing in
another folder by creating another python file
4. Write simple use cases to test various rides and provide the answers.

You might also like