Question: C++ 1. What does the following code print? int m = 88, k = 99; int* ptr = &m; int &a = k; ptr =
C++
1. What does the following code print?
int m = 88, k = 99; int* ptr = &m; int &a = k; ptr = &k; cout << *ptr + 2; cout << a 2;
2. How do you reserve the decimal part for this average?
int sum = 88; int n = 10; double average = sum / n;
3. Use this Employee class constructor to create an employee object whose name is Jane Doe with salary of 50000.00. Employee:: Employee(string name, double start_salary);
4. Define the member function getDiagonal.
class Rectangle { public: Rectangle(): width(1), length(1) {} // default constructor ..... // define a function getDiagonal const(...) below. You may use sqrt() and pow().
private: double width; double length; };
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
