Question

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
// 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

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

CODE

#include <iostream>

using namespace std;

class Automobile {

private:

string vin, make, model, color;

public:

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

this->vin = vin;

this->make = make;

this->model = model;

this->color = color;

}

string getVin(){

return vin;

}

string getMake() {

return make;

}

string getModel() {

return model;

}

string getColor() {

return color;

}

};

int main() {

cout << "Please enter the Vehicle Identification Number: ";

string vin;

cin >> vin;

cout << "Please enter the Make: ";

string make;

cin >> make;

cout << "Please enter the Mode: ";

string model;

cin >> model;

cout << "Please enter the color: ";

string color;

cin >> color;

Automobile myAuto(vin, make, model, color);

cout << "VIN: "<< myAuto.getVin() << endl;

cout << "Make: "<< myAuto.getMake() << endl;

cout << "Model: "<< myAuto.getModel() << endl;

cout << "Color: "<< myAuto.getColor() << endl;

}

Add a comment
Know the answer?
Add Answer to:
Please put the following pseudocode into C++. // Start // Declarations // Automobile myAuto // string...
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++. 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...

  • 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...

  • Please code this in C++: // Start // Declarations // number currentTuition // number futureTuition //...

    Please code this in C++: // Start // Declarations // number currentTuition // number futureTuition // number interestRate // number numYears // number year // // output "Please enter current tuition: " // input currentTuition // output "Please enter interest rate (e.g. 9.0 for 9 percent): " // input interestRate // output "Please number of years for tuition: " // input numYears // output “Tuition at year 1 is “, currentTuition // // futureTuition = currentTuition // for year =...

  • I need this coded in C++. I keep coming up with errors. // Start // Declarations...

    I need this coded in C++. I keep coming up with errors. // Start // Declarations // number id // string ownerName // string breed // number age // number weight // number weeklyFee // // output "Please enter owner's ID: " // input id // output "Please enter owner's name: " // input ownerName // output "Please enter dog's breed (no space in input, use '_' // instead; For example Great_Dane): " // input breed // output "Please enter...

  • using the following pseudocode what C++ data types should be used for the variable "finalAmount" //...

    using the following pseudocode what C++ data types should be used for the variable "finalAmount" // Start Declarations num amount num newAmount num interestRate output "Please enter the dollar amount. // input amount output "Please enter the interest rate (e.g., nine percet should be entered as 9.0). // input interestRate newAmount FutureValue (amount, interestRate) // output "The new dollar amount is ", newAmount // Stop 17 num FutureValue (num initialAmount, num interestRate) Declarations num finalAmount finalAmount = (1 + interestRate/100)...

  • What C++ data type should be returned from the function/method? // Start //     Declarations //       num amount //       num...

    What C++ data type should be returned from the function/method? // Start //     Declarations //       num amount //       num newAmount //       num interestRate //     output "Please enter the dollar amount.   " //     input amount //     output "Please enter the interest rate(e.g., nine percet should be entered as 9.0).   " //     input interestRate //     newAmount = FutureValue(amount,interestRate) //     output "The new dollar amount is ", newAmount // Stop // // // // num FutureValue(num initialAmount, num interestRate) //     Declarations //       num finalAmount //     finalAmount = (1 + interestRate/100) * initialAmount // return finalAmount

  • Turning this Pseudocode into the described C++ Program? (will include Pseudocode AND Description of the Program...

    Turning this Pseudocode into the described C++ Program? (will include Pseudocode AND Description of the Program below!) Pseudoode: start   Declarations num deptNum num salary num hrsWorked num SIZE = 7 num totalGross[SIZE] = 0 string DEPTS[SIZE] = “Personnel”, “Marketing”,   “Manufacturing”, “Computer Services”, “Sales”, “Accounting”, “Shipping”                                                      getReady()    while not eof detailLoop()    endwhile    finishUp() stop getReady()    output “Enter the department number, hourly salary, and number of hours worked”    input deptNum, salary, hrsWorked return detailLoop()    if deptNum >= 1 AND deptNum...

  • Find Bugs in the pseudocode // A high school is holding a recycling competition // This program allows a user to enter a student's // year in school (1 through 4) // and number of cans collected // Data is entered continuously until the user wnats

    Find Bugs in the pseudocode// A high school is holding a recycling competition// This program allows a user to enter a student's // year in school (1 through 4)// and number of cans collected// Data is entered continuously until the user wnats to quit// After headings, output is four lines// one for each school year classstart   Declarations      num year      num cans      num SIZE = 4      num QUIT = 9    ...

  • I need this in java please Create an automobile class that will be used by a...

    I need this in java please Create an automobile class that will be used by a dealership as a vehicle inventory program. The following attributes should be present in your automobile class: private string make private string model private string color private int year private int mileage. Your program should have appropriate methods such as: default constructor parameterized constructor add a new vehicle method list vehicle information (return string array) remove a vehicle method update vehicle attributes method. All methods...

  • The following files starts with some comments that describe the problem comments are lines that begin with two slashes(//). following the comments the file contains pseudocode that has one or more bu...

    The following files starts with some comments that describe the problem comments are lines that begin with two slashes(//). following the comments the file contains pseudocode that has one or more bugs you must find and correct Class Class 12. Debug (5 points) The following file starts with some comments that describe the prolblemcnpseudocode lines that begin with two slashes Un). Following the comments, the file that has one or more bugs you must find and correct. This Eile defines...

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