Start learning 50% faster. Sign in now
In object-oriented programming (OOP), private class members (such as variables or methods) are used to enforce encapsulation and data hiding. Here’s a detailed explanation of their purpose and benefits: • Encapsulation: Private class members are intended to be accessible only within the class that defines them. This encapsulation helps in hiding the internal state and implementation details of the class from the outside world, allowing the class to maintain control over its own data and behavior. • Data Hiding: By making members private, a class can prevent external code from directly accessing or modifying its internal data. This ensures that the internal state of an object is protected from unintended or unauthorized changes, which can help maintain the integrity and consistency of the object's state.
A shopkeeper sells an article for Rs. 506, earning a profit of 15%. If the same article is sold for Rs. 396, what would be the profit or loss percentage?
A man buys a vase for Rs. 36 and sells it for Rs. 54. Find his gain per cent.
A shopkeeper bought an article and marked it at Rs. 350. By selling the article at a discount of 4%, he earns a profit of 20%. Find the cost price of th...
By selling a TV set for Rs 16,800 a salesman gains a profit of 20%. If the production cost is increased by 20%, find the new selling price of the set to...
Two vendors sell an electronic gadget for Rs. 1500, making a profit of 20%. One vendor calculates his profit based on cost price, while the other consid...
A shopkeeper marked an article Rs. 850 above its cost price and sold it after giving a discount of 30% and earned a profit of 20%. Find the cost price o...
Anita sold a necklace after giving a discount of 15% and earned a profit of Rs. 850. If she had sold it for Rs. 200 less, she would have earned a profit...
A trader marked an article 70% above its cost price and sold it after allowing a discount of 40%. If the transaction resulted in a profit of Rs. 24, the...
A shopkeeper earns a profit of 30% by selling an article. What would be the approximate percent change in the profit percent, if he had paid 20% less an...
Cost price of a bag is Rs.500. The shopkeeper marked it 60% above the cost price and sold it after giving a discount of 22%. If the shopkeeper had sold ...