Construct logical expressions to represent conditions.
Q11. Construct logical expressions to represent the following conditions:
- weight is greater than or equal to 115 but less than 125
- x is even
- donation is in the range 4000-5000 or guest is 1.
- ch is an uppercase letter.
Ans.(1). weight>=115 && weight<125
Ans.(2). x%2 == 0
Ans.(3). donation >= 4000 && donation <= 5000 || guest = 1
Ans.(4). ch >= 65 && ch <= 90
(The ASCII codes for uppercase characters are from 65 to 90).