pseudocode this for me and please explain since im new to this.
pseudocode this for me and please explain since im new to this.
This is a python 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('\n\nfor personal dtails enter 1\nfor salary dtails enter 2\nfor gadget dtails and cost calculation enter 3\nfor 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\nenter 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\nenter 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
Solved in 2 steps with 2 images









