Projectreport Py

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 14

PROJECT REPORT ON

Computer Science
code 083
Grade XII

CERTIFICATE

This is to verify that Project ____________________ was legitimately completed under my


direct supervision and direction by __________ of class XII Session 2023-24 in partial
fulfillment of CBSE Examination 2023-24 and has been carried out under my direct supervision
and guidance. This report or a similar report on the topic has not been for any other
examination and does not form a part of any other course undergone by the candidate.

_____Sign____
Student Name:

Examiner:

Name: _______________
Signature:
TABLE OF CONTENTS
S NO DESCRIPTION PAGE NO

01 Acknowledgement 4

03 Introduction 5

04 Objectives of the project 6

05 Team role 7

06 Theoretical background 8

08 Source code

09 Output

11 Hardware and software requirements

12 References
ACKNOWLEDGEMENT

I would like to express my heartfelt gratitude to the following individuals and organizations
for their invaluable contributions and unwavering support throughout the completion of
this project:

My sincere thanks to Ms. Shweta Sorout for her technical assistance, guidance, expertise,
and insightful feedback that greatly enriched the quality of this project. I am indebted to
Principal Ms. Jyoti Bhalla for her constant encouragement, patience, and understanding
during the entire duration of this endeavor.

I extend my appreciation to Manaskriti School for providing access to resources that was
crucial in gathering the necessary data for this project.

I am thankful to my friends and family for their unwavering belief in me and their
continuous encouragement that kept me motivated.

Lastly, I would like to acknowledge the support of all those individuals who may have
contributed in various ways, big or small, to the successful completion of this project.

Thank you all for your unwavering support, guidance, and contributions. This project would
not have been possible without each and every one of you.

INTRODUCTION
This programme first asks the user that this is a first time he using the programme on his/her
system. If the entered option is correct the programme automatically run the commands
which is necessary to run this programme perfectly. This programme helps the user to order
food from various restaurant. After entering details, this programme automatically shows the
names of Restaurant. The user can choose the restaurant name to view its Menu card and
order food that he likes. This programme also allows the user to enter the feedback. This
programme admin controls has various kinds of options like create a new menu card, update
a menu card, delete a menu card, see customer details and see the feedback of the customer.
However, this admin function can only be accessible only if the entered admin-id and
password is correct.

OBJECTIVES OF THE PROJECT

The objective of this project is to let the students apply the programming knowledge into a

real- world situation/problem and expose the students how programming skills help in

developing a good software.


TEAM ROLES

ROLE ROLE DISCRIPTION TEAM


MEMBER
NAME
CREATE MODULES CREATE_RES, READ_RES Abhinav
PROGRAMMER & RES_1 AND CREATE CUSTOMER
CONTROLS
PROGRAMMER CREATE MODULES RES_2, RES_3, RES_4 & Harsh
SEARCH_RES
PROGRAMMER AND CREATE ADMIN CONTROLS AND DEBUG Amit
DEBUGGER THE CODE

THEORETICAL BACKGROUND
What is Python?
Python is an open source, Object-Oriented-High-Level programming language developed by
Guido Van Rossum in 1991 at the National Research Institute for Mathematics, Netherlands.
Features of Python:
• It is used for both scientific and non-scientific programmin
Installing Python:
It can be installed by using website: https://www.python.org/downloads/
Interacting with Python:

Python programs can be run in two ways:


• Using Command line window

• Using IDLE
What is File Handling?

A file in itself is a bunch of bytes stored on some storage devices like hard-disk, thumb-drive etc.
The data files can be stored in two ways: i. Text files ii. Binary files A text file stores information
in ASCII or Unicode characters, where each line of text is terminated, (delimited) with a special
character known as EOL (End of Line) character. In text files some internal translations take place
when this EOL character is read or written. A binary file is just a file that contains information in
the same format in which the information is held in memory, i.e., the file content that is returned
to you is raw (with no translation or no specific encoding). The open() function is used to open a
data file in a program through a file-object (or a file-handle). A file-mode governs the type of
operations (e.g., read/ write/ append) possible in the opened file i.e., it refers to how the file will
be used once it's opened.A text file can be opened in these file modes: 'r', 'w', 'a', 'r+', 'w+', 'a+' A
binary file can be opened in these file modes: 'rb', 'wb', 'ab', 'r+b'('rb+'), 'w+b'('wb+'); a+b'('ab+').
The three file reading functions of Python are: read(), readline(), readlines() While read() reads
some bytes from the file and returns it as a string, readline() reads a line at a time and readlines()
reads all the lines from the file and returns it in the form of a list. The two writing functions for
Python data files are write() and writelines(). While write() writes a string in file, writelines() writes
a list in a file. The input and output devices are implemented as files, also called standard
streams. There are three standard streams: stdin (standard input), stdout (standard
output) and stderr (standard error) The absolute paths are from the topmost level of
the directory structure. The relative paths are relative to current working directory
denoted as a dot(.) while its parent directory is denoted with two dots(..). The full
name of a file or a directory is called pathname. Steps to Process a file: there are
five steps to use files in the python program.
i.Determine the type of file usage Under this step, you need to determine whether you need
to open the file for reading purpose (input type of usage) or writing purpose (output type of
usage).
ii.Open the file and assign its reference to a file-object or file-handle Next, you need
to open the file using open() and assign it to a file-handle on which all the file-operations will
be performed. Just remember to open the file in the file-mode that you decided in step 1.
iii.Now process as required as per the situation, you need to write instructions to process the
file as desired. For example, you might need to open the file and then read it one line at a
time while making some computation, and so on.
iv.Close the file This is very important step especially if you have opened the file in write mode.
This is because, sometimes the last lap of data remains in buffer and is not pushed on to disk
until a close() operation is performed.

What is Text File Handling?


A text file stores information in the form of a stream of ASCII or Unicode
characters (the one which is default for your programming platform). In text files,
each line in text is terminated, (delimited) with a special character (as per the
Operating System) known as EOL (End of Line) character. In text files, some
internal transformation take place when this EOL character is read or written. In
Python, by default, this EOL character is newline character (“\n”) or carriage-return,
newline combination (“\r\n”):

i.Regular Text Files: These are the text files which stores the text in the
same form as typed. Here the newline character ends a line and the text
translation takes place. These files have a file extension as .txt.
ii. Delimited Text Files: In these text files, a specific character is stores to
separate the values, i.e., after each value, e.g., a tab or a comma after every value.

• When a tab character is used to separate the values stored, these are called
TSV files (Tab Separated Values files). These files can take the extension as
.txt or .csv.
• When a comma is used to separate the values stored, these are called CSV
files (Comma Separated Values files). These files take the extension as .csv.
SOURCE CODE
import csv

class HotelManagement:
def _init_(self):
self.guests = []
self.csv_file = 'hotel_guests.csv'
self.load_guests_from_csv()

def load_guests_from_csv(self):
try:
with open(self.csv_file, 'r', newline='') as file:
reader = csv.DictReader(file)
self.guests = list(reader)
except FileNotFoundError:
self.guests = []

def save_guests_to_csv(self):
with open(self.csv_file, 'w', newline='') as file:
fieldnames = ['Name', 'Room Number', 'Check-In Date', 'Check-Out Date']
writer = csv.DictWriter(file, fieldnames=fieldnames)
writer.writeheader()
writer.writerows(self.guests)

def add_guest(self, name, room_number, check_in_date, check_out_date):


guest_data = {
'Name': name,
'Room Number': room_number,
'Check-In Date': check_in_date,
'Check-Out Date': check_out_date,
}
self.guests.append(guest_data)
self.save_guests_to_csv()
print(f"Guest '{name}' added successfully!")

def list_guests(self):
if not self.guests:
print("No guests are currently checked in.")
else:
print("\n--- List of Guests ---")
for index, guest in enumerate(self.guests, start=1):
print(f"{index}. Name: {guest['Name']}, Room: {guest['Room Number']}, Check-
In: {guest['Check-In Date']}, Check-Out: {guest['Check-Out Date']}")

def main():
hotel_manager = HotelManagement()
while True:
print("\n--- Hotel Management ---")
print("1. Check-In Guest")
print("2. List Guests")
print("3. Check-Out Guest")
print("4. Quit")

choice = input("Enter your choice: ")

if choice == '1':
name = input("Enter guest's name: ")
room_number = input("Enter room number: ")
check_in_date = input("Enter check-in date: ")
check_out_date = input("Enter check-out date: ")
hotel_manager.add_guest(name, room_number, check_in_date, check_out_date)

elif choice == '2':


hotel_manager.list_guests()

elif choice == '3':


name = input("Enter guest's name to check out: ")
print("Guest" ,name,"checked out successfully!")

elif choice == '4':


print("Exiting the hotel management system. Goodbye!")
break

if _name_ == "_main_":
main()
OUTPUT
References
1)https://www.programiz.com/pythonprogramming/o
nline_compiler/
2)https://drive.google.com/drive/folders/1zKBncvOSM
dMJabEG4p1ItVrPRDWgxhN

You might also like