To decide on an employee's work allotment, the manager asks for his/her age, sex (M or F), marital status (Y or N). He then applies the following rules to decide on their place of service: If the employee is a female and is married, then she will work in urban areas. If the employee is a male, married and if the age is between 20 and 40, then he could be put to work anywhere. If employee is a male, unmarried and if the age is between 40 and 60, then he will work in urban areas. Write an algorithm for the same.
Answers
Answered by
1
Answer:
Explanation:
start
read age as a
read sex "f" as b
read sex "M" as c
read marital status yes as d
read marital status no as e
if b=d
print she will work in urban areas
if c=d & 20<=a>=40
print he could be put to work anywhwere
if c=e & 40<=a>=60
print he will work in urban areas
stop
Answered by
1
Answer:
Start
Collect the employee's age, sex, and marital status.
if F=Y then print "she will work in urban areas"
if M=Y & 20<=age>=40 then print "he could be put to work anywhere"
if M=N & 40<=age>=60 then print "he will work in urban areas"
End
Similar questions
Biology,
5 months ago
Business Studies,
5 months ago
Math,
5 months ago
Computer Science,
9 months ago
Math,
1 year ago
Math,
1 year ago