Question

Please put the following pseudocode into C++. Below the pseudocode is a header file as well...

Please put the following pseudocode into C++. Below the pseudocode is a header file as well as a cpp file that needs to be included.

// Start
// Declarations
// Automobile myAuto
// string vin
// string make
// string model
// string color
// output "Please enter the Vehicle Identification Number: "
// input vin
// output "Please enter the Make: "
// input make
// output "Please enter the Mode: "
// input model
// output "Please enter the color: "
// input color
// Set the VIN for myAuto
// Set the Make for myAuto
// Set the Model for myAuto
// Set the Color for myAuto
// output "VIN: ", myAuto.getVin()
// output "Make: ", myAuto.getMake()
// output "Model: ", myAuto.getModel()
// output "Color: ", myAuto.getColor()
// Stop

Header file is named Automobile.h that includes the following code:
#include <string>

using namespace std;

#ifndef _Automobile
#define _Automobile
class Automobile
{
private:
   string vin; // first name
   string make; // last name
   string model; // subject of the paper
   string color; // assigned letter grade

public:
   Automobile( );
   void setVin(string v);
   void setMake(string ma);
   void setModel(string mod);
   void setColor(string c);
   string getVin( );
   string getMake( );
   string getModel( );
   string getColor( );
   void displayAutomobile();

};
#endif

cpp file is named Automobile.cpp which includes the following code:
#include <cstdlib>
#include <iostream>
#include "Automobile.h"

using namespace std;

Automobile::Automobile( )
{
vin=""; // Vehicle Identification
make=""; // Make
model=""; // Model
color=""; // Color
}
void Automobile::setVin(string v)
{
vin = v;
}
void Automobile::setMake(string ma)
{
make = ma;
}
void Automobile::setModel(string mod)
{
model = mod;
}
void Automobile::setColor(string c)
{
color = c;
}
string Automobile::getVin( )
{
return vin;
}
string Automobile::getMake( )
{
return make;
}
string Automobile::getModel( )
{
return model;
}
string Automobile::getColor( )
{
return color;
}

void Automobile::displayAutomobile()
{
   cout << "Vehicle Identification Number: " << vin << endl
       << "Make: " << make << endl
       << "Model: " << model << endl
       << "Color: " << color << endl;
}

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Automobile.h

#include <iostream>

#include <string>

using namespace std;

class Automobile

{

private:

string vin;

string make;

string model;

string color;

public:

Automobile();

Automobile(string, string, string, string);

string getVin();

string getMake();

string getModel();

string getColor();

void setVin(string);

void setMake(string);

void setModel(string);

void setColor(string);

void displayAutomobile();

};

Automobile.cpp

#include "Automobile.h"

Automobile::Automobile()

{

this->vin = "";

this->make = "";

this->model = "";

this->color = "";

}

Automobile::Automobile(string vin, string make, string model, string color)

{

this->vin = vin;

this->make = make;

this->model = model;

this->color = color;

}

string Automobile::getVin(){ return this->vin; }

string Automobile::getMake(){ return this->make; }

string Automobile::getModel(){ return this->model; }

string Automobile::getColor(){ return this->color; }

void Automobile::setVin(string vin){ this->vin = vin; }

void Automobile::setMake(string make){ this->make = make; }

void Automobile::setModel(string model){ this->model = model; }

void Automobile::setColor(string color){ this->color = color; }

void Automobile::displayAutomobile()

{

cout << "Vehicle Identification Number: " << vin << endl

<< "Make: " << make << endl

<< "Model: " << model << endl

<< "Color: " << color << endl;

}

main.cpp

#include "Automobile.h"

int main()

{

Automobile auto1;

auto1.setVin("1HGBH41JXMN109186");

auto1.setMake("Chrysler");

auto1.setModel("Chevvy");

auto1.setColor("Black");

cout << endl;

auto1.displayAutomobile();

return 0;

}

******************************************************************** SCREENSHOT *******************************************************

Vehicle Identification Number: 1HGBH41JXMN109186 Make: Chrysler Model: Chevvy Color: Black

Add a comment
Know the answer?
Add Answer to:
Please put the following pseudocode into C++. Below the pseudocode is a header file as well...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Please put the following pseudocode into C++. // Start // Declarations // Automobile myAuto // string...

    Please put the following pseudocode into C++. // Start // Declarations // Automobile myAuto // string vin // string make // string model // string color // output "Please enter the Vehicle Identification Number: " // input vin // output "Please enter the Make: " // input make // output "Please enter the Mode: " // input model // output "Please enter the color: " // input color // Set the VIN for myAuto // Set the Make for myAuto...

  • This one is a little tricky for me. Please put the following pseudocode into C++. Below...

    This one is a little tricky for me. Please put the following pseudocode into C++. Below the pseudocode is a header file as well as a cpp file that needs to be included. // Start // Declarations // TermPaper paper1 // string firstName // string lastName // string subject // character grade // output "Please enter first name. " // input firstName // output "Please enter last name. " // input lastName // output "Please enter subject. " // input...

  • This is a c++ program. Use the description from Parking Ticket Simulator (listed below) as a basis, where you need to...

    This is a c++ program. Use the description from Parking Ticket Simulator (listed below) as a basis, where you need to create a Car class and Police Officer class, to create a new simulation. Write a simulation program (refer to the Bank Teller example listed below) that simulates cars entering a parking lot, paying for parking, and leaving the parking lot. The officer will randomly appear to survey the cars in the lot to ensure that no cars are parked...

  • Please Help. C++. Need 3 attributes and 3 methods added to the code below. Need the...

    Please Help. C++. Need 3 attributes and 3 methods added to the code below. Need the prototype added to the .h file......and the implementation in the .cpp file....thanks! edited: I just need the above and then I was told to use the methods in the main program; for the vehicle. Any 3 attributes and any three methofds. source.cpp file // Header Comment #include #include #include #include "Automobile.h" using namespace std; struct Address{ string street; string city; string state; string zip;...

  • In Source file: Insert comments describing set of statements as indicated. Check format of output. ====================================================================================================...

    In Source file: Insert comments describing set of statements as indicated. Check format of output. ==================================================================================================== #include <iostream> #include "Vehicle.h" #include "Warranty.h" #include "Hybrid.h" using namespace std; //insert comment describing these set of statements here void DisplayDivider(string); string GetInput(string); void DisplayApplicationInformation(); void TerminateApplication(); int main() {    DisplayDivider("Start Program");    DisplayApplicationInformation();    //insert comment describing these set of statements here    DisplayDivider("Vehicle 1");    vehicle vehicle1;    vehicle1.setMake(GetInput("vehicle make"));    vehicle1.setYear(GetInput("vehicle year"));    vehicle1.setMileage(GetInput("vehicle MPG"));    warranty warranty1;    warranty1.setNumYears(atoi(GetInput("number...

  • Please Implement ParkingLot.cpp below based off the completed Automobile Class and ClaimCheck class down below. Automobile.hpp...

    Please Implement ParkingLot.cpp below based off the completed Automobile Class and ClaimCheck class down below. Automobile.hpp #pragma once #include <iostream> #include <string> class Automobile { friend bool operator==( const Automobile& lhs, const Automobile& rhs ); friend std::ostream & operator<<( std::ostream& stream, const Automobile& vehicle ); private: std::string color_; std::string brand_; std::string model_; std::string plateNumber_; public: Automobile( const std::string & color, const std::string & brand, const std::string & model, const std::string & plateNumber ); }; bool operator!=( const Automobile& lhs, const...

  • Language = C++ How to complete this code? C++ Objects, Structs and Linked Lists. Program Design:...

    Language = C++ How to complete this code? C++ Objects, Structs and Linked Lists. Program Design: You will create a class and then use the provided test program to make sure it works. This means that your class and methods must match the names used in the test program. Also, you need to break your class implementation into multiple files. You should have a car.h that defines the car class, a list.h, and a list.cpp. The link is a struct...

  • //Vehicle.h #pragma once #include<iostream> #include"Warranty.h" #include<string> using namespace std; class Vehicle{ protected:    string make; int year;   ...

    //Vehicle.h #pragma once #include<iostream> #include"Warranty.h" #include<string> using namespace std; class Vehicle{ protected:    string make; int year;    double mpg;    Warranty warranty;    static int numOfVehicles; public:    Vehicle();    Vehicle(string s, int y, double m, Warranty warranty);    Vehicle(Vehicle& v);    ~Vehicle();    string getMake();    int getYear();    double getGasMileage();    void setMake(string s);    void setYear(int y);    void setYear(string y);    void setGasMileage(double m);    void setGasMileage(string m);    void displayVehicle();    static int getNumVehicles();    Warranty getWarranty();    void setWarranty(Warranty& ); }; //Vehicle.cpp #include "Vehicle.h" #include <string> Vehicle::Vehicle() {    make = "unknown";    year =...

  • #include <iostream> #include "Vehicle.h" #include "Warranty.h" #include "Hybrid.h" using namespace std; //insert comment describing these set...

    #include <iostream> #include "Vehicle.h" #include "Warranty.h" #include "Hybrid.h" using namespace std; //insert comment describing these set of statements here void DisplayDivider(string); string GetInput(string); void DisplayApplicationInformation(); void TerminateApplication(); int main() {    DisplayDivider("Start Program");    DisplayApplicationInformation();    //insert comment describing these set of statements here    DisplayDivider("Vehicle 1");    vehicle vehicle1;    vehicle1.setMake(GetInput("vehicle make"));    vehicle1.setYear(GetInput("vehicle year"));    vehicle1.setMileage(GetInput("vehicle MPG"));    warranty warranty1;    warranty1.setNumYears(atoi(GetInput("number of years covered under warranty").c_str()));    warranty1.setNumMiles(atoi(GetInput("number of miles covered under warranty").c_str()));    vehicle1.setWarranty(warranty1);    vehicle1.displayVehicle();...

  • CIS247C Week 3 Project Overview The objective of this week is to enhance last week's Vehicle cla...

    CIS247C Week 3 Project Overview The objective of this week is to enhance last week's Vehicle class by making the following changes: • Create a static variable called numVehicles that holds an int and initialize it to zero. This will allow us to count all the Vehicle objects created in the main class. • Add the copy constructor • Increment numVehicles in all of the constructors • Decrement numVehicle in destructor • Add overloaded versions of setYear and setMpg that...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT