write c++ code for Design a class named Computer that holds the make, model, and amount of memory of a computer. Include methods to set the values for each data field, and include a method that displays all the values for each field. Create the class diagram and write the pseudocode that defines the class.   // Pseudocode PLD Chapter 10 #4 pg. 461 // Start // Declarations // Computer myComputer // string make // string model // int memory // output "Please enter the Make: " // input make // output "Please enter the Model: " // input model // output "Please enter the Amount of Memory: " // input memory // Set the Make for myComputer // Set the Model for myComputer // Set the Amount of Memory for myComputer // output "Make: ", myComputer.getMake() // output "Model: ", myComputer.getModel() // output "Amount of Memory: ", myComputer.getMemory() // Stop   header #include using namespace std; #ifndef _Computer #define _Computer class Computer { private: string make; // computer make string model; // computer model int memory; // computer RAM public: Computer( ); void setMake(string ma); void setModel(string mod); void setMemory(int mem); string getMake( ); string getModel( ); int getMemory( ); void displayComputer(); }; #endif     #include #include #include "Computer.h" using namespace std; Computer::Computer( ) { make=""; // Make model=""; // Model memory=0; // RAM } void Computer::setMake(string ma) { make = ma; } void Computer::setModel(string mod) { model = mod; } 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: " << memory << endl; }   An example of what I need help written: // This program uses the programmer-defined Vehicle class.  #include #include "Vehicle.h" using namespace std;  int main() {    Vehicle vehicleOne;        vehicleOne.setMaxSpeed(100.0);    vehicleOne.setSpeed(35.0);    vehicleOne.accelerate(10.0);    cout << "The current speed is " << vehicleOne.getSpeed() << endl;    vehicleOne.accelerate(60.0);    cout << "The current speed is " << vehicleOne.getSpeed() << endl;        return 0; }

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter11: Inheritance And Composition
Section: Chapter Questions
Problem 5PE: Using classes, design an online address book to keep track of the names, addresses, phone numbers,...
icon
Related questions
Question

write c++ code for

Design a class named Computer that holds the make, model, and amount of memory of a computer. Include methods to set the values for each data field, and include a method that displays all the values for each field. Create the class diagram and write the pseudocode that defines the class.

 

// Pseudocode PLD Chapter 10 #4 pg. 461
// Start
// Declarations
// Computer myComputer
// string make
// string model
// int memory
// output "Please enter the Make: "
// input make
// output "Please enter the Model: "
// input model
// output "Please enter the Amount of Memory: "
// input memory
// Set the Make for myComputer
// Set the Model for myComputer
// Set the Amount of Memory for myComputer
// output "Make: ", myComputer.getMake()
// output "Model: ", myComputer.getModel()
// output "Amount of Memory: ", myComputer.getMemory()
// Stop

 

header

#include <string>
using namespace std;
#ifndef _Computer
#define _Computer
class Computer
{
private:
string make; // computer make
string model; // computer model
int memory; // computer RAM
public:
Computer( );
void setMake(string ma);
void setModel(string mod);
void setMemory(int mem);
string getMake( );
string getModel( );
int getMemory( );
void displayComputer();
};
#endif

 

 
#include <cstdlib>
#include <iostream>
#include "Computer.h"
using namespace std;
Computer::Computer( )
{
make=""; // Make
model=""; // Model
memory=0; // RAM
}
void Computer::setMake(string ma)
{
make = ma;
}
void Computer::setModel(string mod)
{
model = mod;
}
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: " << memory << endl;
}
 

An example of what I need help written:

// This program uses the programmer-defined Vehicle class. 
#include <iostream>
#include "Vehicle.h"

using namespace std; 
int main()
{
   Vehicle vehicleOne;
   
   vehicleOne.setMaxSpeed(100.0);
   vehicleOne.setSpeed(35.0);
   vehicleOne.accelerate(10.0);
   cout << "The current speed is " << vehicleOne.getSpeed() << endl;

   vehicleOne.accelerate(60.0);
   cout << "The current speed is " << vehicleOne.getSpeed() << endl;
   
   return 0;
}

 
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Data members
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT