Reference no: EM13215188
Complete the lab13_ex2_starter.cpp by
1. show on the console the sum of all non-inherited data members of every instance in the program by Display() function.
2. the sum function needs to be a class method and having the same name for different classes, therefore only one external Display() fucntion is required
3. this Display() fucntion needs to be defined externally as a global function, void Display(Base &), that takes any instance of Base class or derived from Base class.
4. Should the sum can not be obtained, explain the reason in the comment.
Starter: lab13_ex2_starter.cpp
Submit: lab13_ex2.cpp
#include <iostream>
class Base
{
public:
int mPublic;
private:
int mPrivate;
protected:
int mProtected;
public:
int get_mPrivate() {return mPrivate;}
int get_mProtected() {return mProtected;}
Base(int pub, int pri, int pro)
{ mPublic = pub; mPrivate = pri; mProtected = pro; }
};
class Pub: public Base
{
public:
int mPublic;
private:
int mPrivate;
protected:
int mProtected;
public:
int get_mPrivate() {return mPrivate;}
int get_mProtected() {return mProtected;}
Pub(int a, int b, int c, int pub, int pri, int pro) : Base(a, b, c)
{ mPublic = pub; mPrivate = pri; mProtected = pro; }
};
class Pri: private Base
{
public:
int mPublic;
private:
int mPrivate;
protected:
int mProtected;
public:
int get_mPrivate() {return mPrivate;}
int get_mProtected() {return mProtected;}
Pri(int a, int b, int c, int pub, int pri, int pro) : Base(a, b, c)
{ mPublic = pub; mPrivate = pri; mProtected = pro; }
};
class Pro: protected Base
{
public:
int mPublic;
private:
int mPrivate;
protected:
int mProtected;
public:
int get_mPrivate() {return mPrivate;}
int get_mProtected() {return mProtected;}
Pro(int a, int b, int c, int pub, int pri, int pro) : Base(a, b, c)
{ mPublic = pub; mPrivate = pri; mProtected = pro; }
};
int main()
{
Base cBase(1,2,3);
Pub cPub(1,2,3,4,5,6);
Display(cPub);
Display(cBase);
return 0;
}
What will be callies initial capital balance
: Callie is admitted to the Adams & Beal Partnership under the bonus method. Callie contributes cash of $20,000 and non-cash assets with a market value of $30,000 and book value of $15,000 in exchange for a 20% ownership interest in the new partners..
|
Explain what does this indicate the firm''s expected ebitda
: Assume that in five years, DigiVault will have an expected exit enterprise value of $48 million, based on an EBITDA multiple of 5.0 from similar exit transactions. What does this indicate the firm's expected EBITDA will be at that time?
|
Pricing a first to default derivative
: Examine the sensitivity of your answers as you vary the number of simulations from 1000, 10,000, 100,000 and 250,000, Pricing a Second to Default Derivative - Pricing a Second to Default Derivative
|
Define a class named circle
: Define a pure abstract base class called BasicShape. The BasicShape class should have the following members.
|
Show on the console the sum of all non-inherited data member
: show on the console the sum of all non-inherited data members of every instance in the program by Display() function.
|
Prepare all entries required to properly record the sale
: On April 1, 2014, West Company purchased $476,000 of 5.25% bonds for $494,790 plus accrued interest as an available-for-sale security. Interest is paid on July 1 and January 1 and the bonds mature on July 1, 2019.
|
What are the main disadvantages of hypermedia
: What are the main disadvantages of hypermedia when compared with conventional media such as books and videos?
|
How could the company have reduced the costs
: In a recent year, an oil refinery in Texas City, Texas, on the Houston Ship Channel exploded. The explosion killed 14 people and sent a plume of smoke hundreds of feet into the air. The blast started as a fire in the section of the plant that incr..
|
Use the sql command line in oracle to perform
: One of a DBA's primary responsibilities is to create and manage database user accounts and to grant or revoke access privileges as needed. Users should be able to access or modify only those parts of the database that they need to perform their jo..
|