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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!