esign a class named WorkingDays. The purpose of the class is to store a value that represents number of hours worked and then convert it into number of days worked according to the formula given below: 8 working hours = 1 working day For example: v 8 hours would be equal to 1 day v 12 hours would be equal to 1.5 days v 18 hours would be equal to 2.25 days
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
esign a class named WorkingDays. The purpose of the class is to store a value that represents number of hours worked and then convert it into number of days worked according to the formula given below:
8 working hours = 1 working day
For example:
v 8 hours would be equal to 1 day
v 12 hours would be equal to 1.5 days
v 18 hours would be equal to 2.25 days
Step by step
Solved in 2 steps with 3 images