You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Boltu recently started learning advance object oriented concepts. So he asked his brother who is a CSE graduate to give him a OOP exercise. His brother gave him a code(given below)
and asked him to find out the problem and rewrite it. Boltu spent many hours to find out problem but he noticed that the code works fine. His brother then explained him a concept mentioning "Though the code works fine it is not open for extension and not closed for modification". Then Boltu understood and was able to rewrite the given code.
Can you rewrite the code?
Assumptions
More employee position may be included in calculateSalary() method in the future.
Task
Find out the problem and rewrite code accordingly
Reminders
React to the problem if you find it interesting and helpful. This will help others to easily identify good problems to solve.
Feel free to comment about the problem. Is the description unclear? Do you think it is too easy or too difficult than what is mentioned? Comment about it.
Discussion about the solution is OK. But do not paste a solution here. Give a link to the solution instead.
Overview
Boltu recently started learning advance object oriented concepts. So he asked his brother who is a CSE graduate to give him a OOP exercise. His brother gave him a code(given below)
and asked him to find out the problem and rewrite it. Boltu spent many hours to find out problem but he noticed that the code works fine. His brother then explained him a concept mentioning "Though the code works fine it is not open for extension and not closed for modification". Then Boltu understood and was able to rewrite the given code.
Can you rewrite the code?
Assumptions
More employee position may be included in calculateSalary() method in the future.
Task
Find out the problem and rewrite code accordingly
Reminders
The text was updated successfully, but these errors were encountered: