Loading...
Rewrite the following code using the if-else statement: int m= 400; double ch = (m>300) ? (m / 10.0) * 2: (m / 20.0) - 2;
Design a class with the following specifications: Class name: Student Member variables: name – name of student age – age of student mks –marks obtained stream – stream allocated (Declare the variables using appropriate data types) Member methods: void accept() – Accept name, age and marks using methods of Scanner class. void allocation() – Allocate the stream as per following criteria: mks | stream > = 300 | Science and Computer > = 200 and < 300 | Commerce and Computer > = 75 and 200 | Arts and Animation < 75 | Try Again void print() – Display student name, age, mks and stream allocated. Call all the above methods in main method using an object.
© 2026 PadhAiPro. This question is provided for educational purposes.