Question
What is the primary benefit of
polymorphism?Solution
Polymorphism enables writing code that operates on base class references or interface types, but can actually work with objects of any of their derived classes or implementing classes. This leads to more flexible, extensible, and reusable code, as new types can be added without modifying existing code that uses the polymorphic interface.
A shirt has a marked price of Rs 750. A shopkeeper offers a discount of 12% on it. If the value of GST is 5% on the discounted price, find the final pri...
The marked price of a pen and pencil is in the ratio of 5:6. The shopkeeper gives a 10% discount on the pen. If the total discount on both the pen and t...
A company sells two products, X and Y. The selling price of product X is βΉ500, and the selling price of product Y is βΉ800. The company offers a 10%...
A discount of 20% on the price of an article is the same as a discount of 25% on the price of another article. The prices of the two articles will be, ...
An article is marked 40% above the cost price. If a discount of x% is given on the marked price of the article, then a final profit of 12% is obtained. ...
Rohan purchased an item for which there was a 13.5% discount offered on the part of the payment made in cash and a 6.25% surcharge on the part of the p...
1 packet of biscuits costs Rs 16 but a pack of 4 of the same packet of biscuits costs Rs 56. What is the effective discount (in %) on the pack?
The marked price of a toaster and the dryer are in the ratio 1 :2. The shopkeeper gives 20% discount on the toaster. If the total discount on the toaste...
What is the single percentage discount equivalent to two successive discounts of 15% and 5%?
An item with a marked price of βΉ4,000 was sold for βΉ3,492 after a discount of y% was offered. What was the value of y?