Question
write a user manual for this code detail_emp={} inventary={'R':0,'S':0,'L':0,'M':0} name_gadget={'R':'Router',S:'Switches',L:Laptop,M:Mainframe} def main( ): n=input(' for personal dtails enter 1 for salary dtails enter 2
write a user manual for this code
detail_emp={}
inventary={'R':0,'S':0,'L':0,'M':0}
name_gadget={'R':'Router',"S":'Switches',"L":"Laptop","M":"Mainframe"}
def main( ):
n=input(' for personal dtails enter 1 for salary dtails enter 2 for gadget dtails and cost calculation enter 3 for exit enter 0')
while n !='0':
if n=='1':
personal()
break
elif n=='2':
salary()
break # here we implement main function
elif n=='3':
gadget()
break
elif n=='0':
exit()
else:
n=input('please enter valid entry')
def personal():
n=input('enter 1 for adding emplyee details enter 2 for display details')
if n=='1':
name=input('enter name') # store details of employee
detail_emp[name]=[name,' ',input('enter phone number'),' ',input('enter designation')]
elif n=='2':
for i in list(detail_emp.keys()): # it is used to display each employee detail
det=detail_emp[i]
print(*det)
else:
print('not valid entry')
main()
def salary():
nam=input('enter employee name')
h_w=float(input('enter wages per hour of '+nam))
h=float(input('enter no of hour '+nam+' worked in month'))
print('salary of ',nam,' is ',h_w*h)
main()
def gadget():
print('inventary: ',inventary['R'],' Routers,',inventary["S"],' Switches,',inventary["L"],' laptops,',inventary["M"],' Mainframe')
n=input('enter 1 for gadget modification enter 2 for cost')
if n=='1':
n1=input('What do you want to add? Press "R" for router, "S" for switch, "L" for Laptop, "M" for Mainframe')
inventary[n1]+=int(input('How many of '+name_gadget[n1]+ ' do you want to add?'))
elif n=='2':
k=0 # calculate cost of gadets
for i in ['Routers','Switches','laptops','Mainframe']:
price=float(input('enter price of '+i))
no_item=float(input('enter no of item of '+i))
k+=(price*no_item)
print(k)
main()
main()
Step by Step Solution
There are 3 Steps involved in it
Step: 1
User Manual for the Provided Code 1 Introduction This code is designed to manage employee details calculate salaries and handle gadget inventory and c...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started