Hello, I am having trouble with this homework question   Q1: Implement a class called Vehicle. a) A class named Vehicle b) Two private data members: brand (string), model (string), price (int). c) Accessors and Mutators function for brand, value, and price. Use following main() to test your class. int main(){ Vehicle a; a.setBrand("BMW"); a.setModel("X5"); a.setPrice(60000); cout</

Systems Architecture
7th Edition
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Stephen D. Burd
Chapter3: Data Representation
Section: Chapter Questions
Problem 30VE: A(n) ____________ is one instance or variable of a class.
icon
Related questions
Question

Hello, I am having trouble with this homework question

 

Q1: Implement a class called Vehicle.
a) A class named Vehicle
b) Two private data members: brand (string), model (string), price (int).
c) Accessors and Mutators function for brand, value, and price.
Use following main() to test your class.


int main(){
Vehicle a;
a.setBrand("BMW");
a.setModel("X5");
a.setPrice(60000);
cout<<a.getBrand()<<endl; // print BMW
cout<<a.getModel()<<endl; // print X5
cout<<a.getPrice()<<endl; // print 60000
}

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Reference Types in Function
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
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning