design a class name computer that holds the make, model, and amount of memory of a computer. Include methods to set the values for each data field, and a method that displays all the values for each field.
design a class name computer that holds the make, model, and amount of memory of a computer. Include methods to set the values for each data field, and a method that displays all the values for each field.
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
design a class name computer that holds the make, model, and amount of memory of a computer. Include methods to set the values for each data field, and a method that displays all the values for each field.
I need this in C++ code.
Computer.cpp and Computer.h provided
![1000-PLD10-4\Computer.cpp - Dev-C++ 5.11
Search View Project Execute Tools AStyle Window Help
T
(globals)
lasses Debug
****
ort Compilation
1
[*] Computer.cpp [*] Project 10-4.cpp
#include <cstdlib>
#include <iostream>
#include "Computer.h"
using namespace std;
10 0 NOUAWNP
2
3
4
5
6
Computer :: Computer ()
9 (
11
13
14
21
22
į.
26
27
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
make=""; // Make
model=""; // Model
memory=0; // RAM
void Computer::setMake(string ma)
make
*****
maj
}
void Computer::setModel (string mod)
{
model = mod;
b
void Computer::setMemory (int mem)
memory mem;
string Computer::getMake()
{
return make;
}
string Computer::getModel()
{
return model;
}
int Computer::getMemory ()
return memory;
}
void Computer::displayComputer ()
{
cout << "Computer Make: << make << endl
<< "Computer Model: " << model << endl
<< "Comuter Amount of Memory:
mpiler Resources Compile Log ✓ Debug
Compilation results...
11
Debug Find Results Close
/* 1 *
<< memory << endl
I
TDM-GCC 4.9.2 64-bit Re](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F8e50295d-9196-40fc-82ee-f739bb922916%2Fd8ea360d-f820-48d6-ae2d-53d46aeb00bd%2Fjoo06gn_processed.jpeg&w=3840&q=75)
Transcribed Image Text:1000-PLD10-4\Computer.cpp - Dev-C++ 5.11
Search View Project Execute Tools AStyle Window Help
T
(globals)
lasses Debug
****
ort Compilation
1
[*] Computer.cpp [*] Project 10-4.cpp
#include <cstdlib>
#include <iostream>
#include "Computer.h"
using namespace std;
10 0 NOUAWNP
2
3
4
5
6
Computer :: Computer ()
9 (
11
13
14
21
22
į.
26
27
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
make=""; // Make
model=""; // Model
memory=0; // RAM
void Computer::setMake(string ma)
make
*****
maj
}
void Computer::setModel (string mod)
{
model = mod;
b
void Computer::setMemory (int mem)
memory mem;
string Computer::getMake()
{
return make;
}
string Computer::getModel()
{
return model;
}
int Computer::getMemory ()
return memory;
}
void Computer::displayComputer ()
{
cout << "Computer Make: << make << endl
<< "Computer Model: " << model << endl
<< "Comuter Amount of Memory:
mpiler Resources Compile Log ✓ Debug
Compilation results...
11
Debug Find Results Close
/* 1 *
<< memory << endl
I
TDM-GCC 4.9.2 64-bit Re
![C:\COP1000-PLD10-4\Computer.h - Dev-C++ 5.11
File Edit Search View Project
■@** 2
包面口 (globals)
Project Classes Debug
K
hs
10 CONGU AWNP
[*] Computer.cpp [*] Project 10-4.cpp Computer.h
#include <string>
1
using namespace std;
2
3
4
6 class Computer
8
78(1:
9
10
11
12
13
14
Execute Tools AStyle Window Help
65 89 149
16
18
19
#ifndef _Computer
#define _Computer
23
24
25
26
private:
string make; // computer make
string model; // computer model
int memory;
// computer RAM
public:
};
#endif
NE?
Computer();
void setMake(string ma);
void setModel(string mod);
void setMemory (int mem);
string getMake();
string getModel();
int getMemory();
void displayComputer();
品
TDM-GCC 4.9.2](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F8e50295d-9196-40fc-82ee-f739bb922916%2Fd8ea360d-f820-48d6-ae2d-53d46aeb00bd%2Fd5jx678_processed.jpeg&w=3840&q=75)
Transcribed Image Text:C:\COP1000-PLD10-4\Computer.h - Dev-C++ 5.11
File Edit Search View Project
■@** 2
包面口 (globals)
Project Classes Debug
K
hs
10 CONGU AWNP
[*] Computer.cpp [*] Project 10-4.cpp Computer.h
#include <string>
1
using namespace std;
2
3
4
6 class Computer
8
78(1:
9
10
11
12
13
14
Execute Tools AStyle Window Help
65 89 149
16
18
19
#ifndef _Computer
#define _Computer
23
24
25
26
private:
string make; // computer make
string model; // computer model
int memory;
// computer RAM
public:
};
#endif
NE?
Computer();
void setMake(string ma);
void setModel(string mod);
void setMemory (int mem);
string getMake();
string getModel();
int getMemory();
void displayComputer();
品
TDM-GCC 4.9.2
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images

Recommended textbooks for you

Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON

Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning

Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON

Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning

Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education

Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY