Computer Science Project Class Xi Vinay Venugopal
Computer Science Project Class Xi Vinay Venugopal
PROJECT
3. THE INTRODUCTION
1. Python 3.10.5
2. Python IDLE 3.10
3. Spyder IDLE
The main menu of the program:
BILLING
To start the billing, we can give “1” as the input. Upon giving
1 as the input, it shows the list of cakes with egg first with their
code with a choice to move forward:
For adding any cake to the bill, one must enter “Y” or “y” or
“E” or “e” to exit
After every input of a code, the software asks the user if he/she
would like to continue adding or exit to move forward. In the
above Sample input, three cakes having codes 1, 2 and 3 are
selected.
After exiting from the “CAKES WITH EGG” Section, the
software asks the user if he/she would like to add any cakes
without egg for billing.
In the above sample, the codes 19 and 21 are chosen for billing.
Next, the program asks if the user would like to add any extra
birthday items like candles, knifes and caps. In the above
sample input, items 22, 23 and 24 are included.
Next, the bill is printed and the billing menu is again activated.
ADDITION OF A NEW ITEM
For Addition of a new item, the user must enter choice “2”
For the sample input, the changes will be made in “Cakes with
Egg” list by typing in 1:
The program asks the user how many new cakes must be
added. Based on that it asks the used that much of time.
Based on the above sample input we get the following sample
output:
After adding the new item, the user can even bill it by choosing
1 and entering the code “101” from the menu
For updating the list of items present, the user must enter “3”
as the choice in the main menu:
Upon entering “3”, the program asks the user the following:
For deleting the items, the user must enter choice “4” in the
main menu:
The program asks the usere from which he/she wants any item
to be removed.
For the sample input, list “2” is chosen (i.e., from “Cakes
without Egg” section).
Here, the code 20 is deleted from the list. Thus, the cake with
code 20 is removed from the list.
The 5th choice from the menu allows the user to see all the
cakes in the list as follows:
The final choice (i.e., 6th choice) exits from the program:
# Storage Dictionary of all the items:
print ("---------------------------------------------
-----------------------------------------------------
--")
print (" ")
print (" WELCOME TO
BILLING SOFTWARE
")
print ("
V.R, CAKES
")
print (" ")
print ("---------------------------------------------
-----------------------------------------------------
--")
while True:
TB= {}
print ("-------------------------------------
-----------------------------------------------------
----------")
print (" ")
print ("1. Start Billing.")
print("2. Add a new item.")
print("3. Update the items.")
print("4. Deleting the items.")
print("5. Show all the list.")
print("6. Exit.")
if ch == 1:
print(" ")
print("CAKES WITH EGG")
print(" ")
for i in CWE:
print(i, CWE[i])
print(" ")
print(" ")
while True:
VTB = CWE[item]
TB[item] = VTB
print(" ")
print(" ")
print("CAKES WITHOUT EGG")
print(" ")
for i in CWTE:
print(i, CWTE[i])
print(" ")
print(" ")
while True:
item = int(input("Enter The Code
For Each Items: "))
VTB = CWTE[item]
TB[item] = VTB
print(" ")
ch5 = input("[Y-conitnue to
add/E-exit] ")
print(" ")
e=input("Would you like to add any extra
birthday items? [Y-Yes/N-No] ")
if e == "Y" or e == "y":
print(" ")
print("BIRTHDAY ITEMS")
print(" ")
for i in Extra:
print(i, Extra[i])
print(" ")
while True:
item = int(input("Enter The Code
For Each Items: "))
VTB = Extra[item]
TB[item] = VTB
print(" ")
ch6 = input("[Y-conitnue to
add/E-exit] ")
print("----------------------------------
-----------------------------------------------------
-------------")
print("
V.R CAKES - BILL
")
print("----------------------------------
-----------------------------------------------------
-------------")
print("ITEMS-----------------------------
------COST-------------------------------------------
-------------")
print(" ")
for j in TB:
print(TB[j])
elif ch == 2:
print(" ")
print("In which list would you like to
add the new item?")
if ch7 == "1":
print(" ")
print("CAKES WITH EGG")
print(" ")
for i in CWE:
print(i, CWE[i])
for i in range(R):
print(" ")
print("CAKES WITH EGG")
print(" ")
for i in CWE:
print(i, CWE[i])
if ch7 == "2":
print(" ")
print("CAKES WITHOUT EGG")
print(" ")
for i in CWTE:
print(i, CWTE[i])
for i in range(R):
CWTE[Num]=key
print(" ")
print("CAKES WITHOUT EGG")
print(" ")
for i in CWTE:
print(i, CWTE[i])
if ch7 == "3":
print(" ")
print("BIRTHDAY ITEMS")
print(" ")
for i in Extra:
print(i, Extra[i])
for i in range(R):
Extra[Num]=key
print(" ")
print("CAKES WITH EGG")
print(" ")
for i in Extra:
print(i, Extra[i])
elif ch == 3:
print(" ")
print("In which list would you like to
update the new item?")
if ch8 == "1":
print(" ")
print("CAKES WITH EGG")
print(" ")
for i in CWE:
print(i, CWE[i])
CWE[Num]=key
print(" ")
print("CAKES WITH EGG")
print(" ")
for i in CWE:
print(i, CWE[i])
if ch8 == "2":
print(" ")
print("CAKES WITHOUT EGG")
print(" ")
for i in CWTE:
print(i, CWTE[i])
CWTE[Num]=key
print(" ")
print("CAKES WITHOUT EGG")
print(" ")
for i in CWTE:
print(i, CWTE[i])
if ch8 == "3":
print(" ")
print("BIRTHDAY ITEMS")
print(" ")
for i in Extra:
print(i, Extra[i])
Extra[Num]=key
print(" ")
print("BIRTHDAY ITEMS")
print(" ")
for i in Extra:
print(i, Extra[i])
elif ch ==4:
print(" ")
print("In which list would you like to
delete the item?")
if ch9 == "1":
print(" ")
print("CAKES WITH EGG")
print(" ")
for i in CWE:
print(i, CWE[i])
del CWE[Num]
print("The new information: ")
print(" ")
print("CAKES WITH EGG")
print(" ")
for i in CWE:
print(i, CWE[i])
if ch9 == "2":
print(" ")
print("CAKES WITHOUT EGG")
print(" ")
for i in CWTE:
print(i, CWTE[i])
del CWTE[Num]
print(" ")
print("CAKES WITHOUT EGG")
print(" ")
for i in CWTE:
print(i, CWTE[i])
if ch9 == "3":
print(" ")
print("BIRTHDAY ITEMS")
print(" ")
for i in Extra:
print(i, Extra[i])
print(" ")
print("BIRTHDAY ITEMS")
print(" ")
for i in Extra:
print(i, Extra[i])
elif ch == 5:
print("----------------------------------
-----------------------------------------------------
-------------")
print(" ")
print("CAKES WITH EGG")
print(" ")
for i in CWE:
print(i, CWE[i])
print("----------------------------------
-----------------------------------------------------
-------------")
print(" ")
print("CAKES WITHOUT EGG")
print(" ")
for i in CWTE:
print(i, CWTE[i])
print("----------------------------------
-----------------------------------------------------
-------------")
print(" ")
print("BIRTHDAY ITEMS")
print(" ")
for i in Extra:
print(i, Extra[i])
print("----------------------------------
-----------------------------------------------------
-------------")
elif ch == 6:
break
The Following code provides us the dictionaries which already
consists of some information about Cakes
CWE is a dictionary which contains all the information about
Cakes with Egg.
CWTE is a dictionary which contains all the information about
Cakes without Egg
Extra is a dictionary which contains some Birthday Items
Each product is given a code. These codes are the keys for
each of them and each key contains the information of the
product as string including:
1. Cake name
2. Cake weight
3. Cost
Billing Menu
This code lists out the Codes
(Keys) and the cake information The following program
(Value) using a for loop converts all the information
entered a new dictionary the
keys as the same key each
value possessed in their
individual dictionaries.
This new dictionary is TB = {}
where TB stands for
Temporary Bill.
The above code prints the bill. The heading is printed with the
print command while the body of the bill is printed by a for loop
which prints the values only of the temporary bill (TB)