
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
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](https://content.bartleby.com/qna-images/question/8e50295d-9196-40fc-82ee-f739bb922916/d8ea360d-f820-48d6-ae2d-53d46aeb00bd/joo06gn_thumbnail.jpeg)
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](https://content.bartleby.com/qna-images/question/8e50295d-9196-40fc-82ee-f739bb922916/d8ea360d-f820-48d6-ae2d-53d46aeb00bd/d5jx678_thumbnail.jpeg)
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 nowThis is a popular solution!
Step by stepSolved in 3 steps with 1 images

Knowledge Booster
Similar questions
- Create a C++ program that simulates a simple inventory management system for a store. The program should allow users to add new products, update product quantities, and generate reports. Follow these guidelines: 1. Implement a class called Product with attributes such as product ID, name, price, and available quantity. 2. Create a class called Inventory that manages an array of products. Include functions to: • Add new products to the inventory. Update the quantity of existing products. • Display details of all products in the inventory. Generate a report showing low-stock products (quantity less than a specified threshold). 3. Start by prompting the user to enter the initial number of products in the inventory. 4. Display a menu that allows users to choose from the following options: Add a new product. · Update product quantity. Display all products in the inventory. • Generate a low-stock report. • Exit the program. ● 5. For each operation, prompt the user for the necessary…arrow_forwardCreate a python class that holds the following personal data: name, address, age, and phone number. Be sure to include proper accessor and mutuator methods. There should be modifier class that creates three instances of the class described. One instance should hold the information, and the other two should hold the information of friends/family members. This problem has been giving me a lot of trouble. Any help is greatly appreciated. Thanks so much!!arrow_forwardCreate a UML Diagram of a class named Investment with fields called principal and interest. It also contains methods named value_after that returns the value of the investment after n years. The formula for this is p(1+i)ⁿ, where p is the principal, and i is the interest rate.arrow_forward
- Directions: SHOW ALL YOUR WORK. REMEMBER THAT PROGRAM SEGMENTS ARE TO BE WRITTEN IN JAVA. Notes: • Assume that the classes listed in the Java Quick Reference have been imported where appropriate. • Unless otherwise noted in the question, assume that parameters in method calls are not null and that methods are called only when their preconditions are satisfied. • In writing solutions for each question, you may use any of the accessible methods that are listed in classes defined in that question. Writing significant amounts of code that can be replaced by a call to one of these methods will not receive full credit. Consider a guessing game in which a player tries to guess a hidden word. The hidden word contains only capital letters and has a length known to the player. A guess contains only capital letters and has the same length as the hidden word. After a guess is made, the player is given a hint that is based on a comparison between the hidden word and the guess. Each position in the…arrow_forwardIn C++ Create a new project named lab8_1. You will be implementing two classes: A Book class, and a Bookshelf class. The Bookshelf has a Book object (actually 3 of them). You will be able to choose what Book to place in each Bookshelf. Here are their UML diagrams Book class UML Book - author : string- title : string- id : int- count : static int + Book()+ Book(string, string)+ setAuthor(string) : void+ setTitle(string) : void+ print() : void+ setID() : void And the Bookshelf class UML Bookshelf - book1 : Book- book2 : Book- book3 : Book + Bookshelf()+ Bookshelf(Book, Book, Book)+ setBook1(Book) : void+ setBook2(Book) : void+ setBook3(Book) : void+ print() : void Some additional information: The Book class also has two constructors, which again offer the option of declaring a Book object with an author and title, or using the default constructor to set the author and title later, via the setters . The Book class will have a static member variable…arrow_forwardFirst, you need to design, code in Java, test and document a base class, Student. The Student class will have the following information: A. Title of the student (eg Mr, Miss, Ms, Mrs etc)B. A first name (given name)C. A last name (family name/surname)D. Student number (ID) – an integer number (of type long)E. A date of birth (in day/month/year format – three ints) - (Do NOT use the Date class from JAVA)The student class will have at least the following constructors and methods:(i) two constructors - one without any parameters (the default constructor), and one with parameters to give initial values to all the instance variables.(ii) a reasonable number of set and get methods.(iii) methods to compute the final overall mark and the final grade (which will be overridden in the respective child classes). These two methods will be void methods that set the appropriate instance variables. Remember one method can call another method. If you prefer, you can define a single method that sets…arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY

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