C++ Ques
C++ Ques
C++ Ques
1. Create a class Student with ID, marks for 3 subjects, total as instance variables, instance
method to compute the total, and main method to print the student information. Modularize
the code to class and package/namespace levels.
2. Write a C++ Program to read details of a student from a file and copy them to the other.
3. Write a C++ Program to store details of 10 students in an array of Student references and print
them. Develop code with a method in MyFirstClass a) factorial () that computes the factorial
of a given number.
Design a class named QuadraticEquation for a quadratic equation ax2 + bx + c = 0. The class contains:
a) Attributes a, b, and c that represent three coefficients. b) Three getter methods for a, b, and c. c)
A method named getDiscriminant() that returns the discriminant, which is b2 - 4ac. d) The methods
named getRoot1() and getRoot2() for returning two roots of the equation.