-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpycodes100_24_menu_driven_program.py
120 lines (118 loc) · 4.32 KB
/
pycodes100_24_menu_driven_program.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# https://newdigitals.org/2024/02/24/100-basic-python-codes/#menu-driven-program
# Menu-Driven Program
# Implementing a menu-driven program for students who are willing to take admitted to a university called PrepBytes University.
def cse():
print("You will get the following subjects")
print("DSA")
print("DBMS")
print("Computer Networks (CN)")
def it():
print("You will get the following subjects")
print("DSA")
print("DBMS")
print("Computer Networks (CN)")
print("MPMC (Multi processor and Multi Controller)")
print("Information Security")
def ece():
print("You will get the following subjects")
print("Wireless Communication")
print("Switching Theory and Logic Design (STLD)")
print("Mobile Systems Communication")
def ee():
print("You will get the following subjects")
print("Switching Theory and Logic Design (STLD)")
print("Control Systems")
print("Electrical Circuits and Designs")
def mech():
print("You will get the following subjects")
print("Force and Friction")
print("Motors and its Types")
def main():
print("Welcome to PrepBytes University Portal!!!")
print("Select one of the following streams in which you want to study")
while(True):
print("1. Computer Science")
print("2. Information Technology")
print("3. Electronics and Communication")
print("4. Electrical and Electronics")
print("5. Mechanical")
print("10. Exit")
print("Enter the choice number from above")
choice = int(input())
if choice == 1:
print("You have chosen Computer Science.");
cse();
print("Are you sure you want to lock this stream? Choose either A or B.")
print("A. Yes, I'm sure")
print("B. No, I'm not sure")
ch = input()[0]
if ch == 'A':
print("Congratulations!! You are now a CSE student at PrepBytes");
break
elif choice == 2:
print("You have chosen Information Technology.");
it();
print("Are you sure you want to lock this stream? Choose either A or B.")
print("A. Yes, I'm sure")
print("B. No, I'm not sure")
ch = input()[0]
if ch == 'A':
print("Congratulations!! You are now an IT student at PrepBytes");
break
elif choice == 3:
print("You have chosen Electronics and Communication.");
ece();
print("Are you sure you want to lock this stream? Choose either A or B.")
print("A. Yes, I'm sure")
print("B. No, I'm not sure")
ch = input()[0]
if ch == 'A':
print("Congratulations!! You are now an ECE student at PrepBytes");
break
elif choice == 4:
print("You have chosen Electrical and Electronics.");
ee();
print("Are you sure you want to lock this stream? Choose either A or B.")
print("A. Yes, I'm sure")
print("B. No, I'm not sure")
ch = input()[0]
if ch == 'A':
print("Congratulations!! You are now an EE student at PrepBytes");
break
elif choice == 5:
print("You have chosen Mechanical Engineering.");
mech();
print("Are you sure you want to lock this stream? Choose either A or B.")
print("A. Yes, I'm sure")
print("B. No, I'm not sure")
ch = input()[0]
if ch == 'A':
print("Congratulations!! You are now a ME student at PrepBytes");
break
elif choice == 10:
break
else:
print("You have entered an invalid choice.")
if __name__ == '__main__':
main()
#Example I/O
Welcome to PrepBytes University Portal!!!
Select one of the following streams in which you want to study
1. Computer Science
2. Information Technology
3. Electronics and Communication
4. Electrical and Electronics
5. Mechanical
10. Exit
Enter the choice number from above
1
You have chosen Computer Science.
You will get the following subjects
DSA
DBMS
Computer Networks (CN)
Are you sure you want to lock this stream? Choose either A or B.
A. Yes, I'm sure
B. No, I'm not sure
A
Congratulations!! You are now a CSE student at PrepBytes