ven the following declaration for a class that represents a

ven the following declaration for a class that represents a computer in a company\'s Invent write tion (for a class called InstallRecord) that (1) a string field representing the location of the computer and (2) a feld of class simpleDate that holds the installation date. The new class should provide observers for each of the new fields. It should also reimplement the Hrite function. class Computer public: string new Brand, string newModel Computer (string newName, newNumber) int newspeed, string newserial, int

Solution

Given code is:

class Computer

{

public:

Computer(string newName, string newBrand, string newModel, int newSpeed, string newSerial, int newNumber);

string Getname() const;

string Getbrand() const;

string GetModel() const;

int GetSpeed() const;

string Getserial() const;

int GetNumber() const;

void Write() const;

private:

string name;

string brand;

string model;

int speed;

string serialNumber;

int inventoryNumber;

);

10.

public class InstallRecord : public Computer

{

public:

string location;

Date installed;

void Write() const;

}

11.

Computer(string newName, string newBrand, string newModel, int newSpeed, string newSerial, int newNumber)

{

public:

string a,b,c,d;

int e,f;

a = newName;

b = newBrand;

c = newModel;

d = newSerial;

e = newSpeed;

f = newNumber;

}

12.

public InstallRecord(location, installed)

{

string a1;

Date d1;

a1 = location;

d1 = installed;

void Write()

{

cout << \"date is \" d1 << endl;

cout << \"location of the computer is \"a1 << endl;

}

}

13. For suppose \'c\' is the object of Computer class then write() is as follows:

public void Write()

{

a1 = c.GetName();

b1 = c.GetBrand();

c1 = c.GetModel();

d1 = c.GetSpeed();

e1 = c.GetSerial();

f1 = c.GetNumber();

cout << a1 <<endl;

cout << b1 <<endl;

cout << c1 <<endl;

cout << d1 <<endl;

cout << e1 <<endl;

cout << f1 <<endl;

}

 ven the following declaration for a class that represents a computer in a company\'s Invent write tion (for a class called InstallRecord) that (1) a string fie
 ven the following declaration for a class that represents a computer in a company\'s Invent write tion (for a class called InstallRecord) that (1) a string fie
 ven the following declaration for a class that represents a computer in a company\'s Invent write tion (for a class called InstallRecord) that (1) a string fie

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site