Question
Find the distance travelled (in km) by the truck to
reach point B from point A, if a car cover 45% the same distance in 2 hours 42 minutes and a truck covers 60% of the distance in 6 hours. The sum of speed of the car and truck is 160 km/hr.Solution
Let speed of car be s kmph Time taken by car travel total distance = 100/45 x 2.7 = 6 hrs Time taken by truck to cover total distance = 100/60 x 6 = 10 hrs so, s x 6 = (160 - s) x 10 6s = 1600 - 10s so, required distance = 100 x 6 = 600 km
What is a "method" in the context of OOP?
In OOP, a blueprint for creating objects (a particular data structure), providing initial values for state (member variables or attributes), and impleme...
Which special method is automatically called when an object of a class is created, typically used for initializing the object's state?
How is data hiding primarily achieved in OOP?
Which OOP concept allows a class to inherit properties and behaviors from another class?
The ability of an object to take on many forms is known as:
The concept of showing only essential features of an object and hiding the complex implementation details is called:
The ability of an object to take on many forms, or the ability of a single interface to represent different underlying forms, is known as:
Which type of polymorphism is achieved through method overloading (where multiple methods have the same name but different parameters)?
The bundling of data (attributes) and methods (functions) that operate on the data into a single unit (class), and restricting direct access to some of ...