Question
Which SOLID principle ensures that a class has only one
reason to change?Solution
The Single Responsibility Principle (SRP) states that a class should have only one reason to change, meaning it should have only one responsibility or function. This principle promotes cohesion by ensuring each class handles a specific part of the software functionality. For instance, a Customer class should handle customer data, while an Invoice class manages invoice generation. Adhering to SRP simplifies debugging, enhances maintainability, and prevents interdependent changes from cascading through the codebase. Why Other Options Are Incorrect :
- Open/Closed Principle : This emphasizes that classes should be open for extension but closed for modification, unrelated to SRP.
- Liskov Substitution Principle : This ensures that derived classes can replace base classes without altering program correctness.
- Dependency Inversion Principle : This recommends high-level modules should not depend on low-level modules but rather on abstractions.
- Interface Segregation Principle : This advises against forcing a class to implement interfaces it does not use, unrelated to SRP.
(22 × 52 ) + 4 × 6 = ? - √324
What should come in place of (?) question mark in the given expression.
 (25% of 320) + (3/8 of 400) − 30 = ?
(5832)1/3  × 10.11 × 11.97 ÷ 16.32 = ? + 45.022
82% of 400 + √(?) = 130% of 600 - 85% of 400
If (x + 1/x) = 5, then value of x3 + 1/x3 is:
Simplify: (1 ÷ 0.08)
What should come in place of (?) question mark in the given expression.
{ (144 ÷ 12) × 5 } − (18 ÷ 3) = ?
Simplify the following expressions and choose the correct option.
(3/4 of 256) + (2/5 of 150) - (72 ÷ 7)
464 + 181 +? = (154 × 25) - (15) 2 Â
15% of 1800 + 22 = ?Â