ven the following declaration for a class that represents a
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;
}


