Question 8 Consider the following constructor: student (string n, int k) { name
ID: 3770117 • Letter: Q
Question
Question 8
Consider the following constructor:
student (string n, int k)
{
name = n;
no_of_tests = k;
marks = new double [k];
for(int i = 0; i<k; i++)
{
cout << " Enter grade #: "<< i << endl;
cin >> marks[i];
}
Write a destructor for the constructor above.
Question 9
Write a program that ask the user for coefficients a, b, and c of a quadratic equation (ax^2 + bx + c = 0) and return the solutions.
Show me that you wrote it yourself through details, structure, and comments in your code. Remember that a quadratic equation may have one real solution, or two reals solutions, or two complex solutions; a complex number has the form x + yi.
Question 10
Using classes,data, methods and constructors, Write a program that ask the user for:
deposit P
interest rate r
how often the interest is compounded n
years after which they are collecting the total amount t
The program returns the amount colleted A, when P has been deposited into an saving account with interest r compounded n times per year, for t years.
The equation is: A = P*(1 + r/n)^nt
Explanation / Answer
Please post one question at a time.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.