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; }
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 <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;
}

Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images









