Write a cpp program: Design a class Car with two data members car ID, carPrice and following function members: 1. get() function to input values from user. 2. show() function to display values 3. set() function to set values of data members using input parameters 4. getPrice() function to return value of price Now, you need to create two objects of your class and do the following: 1. input values of data members of object1 using get() 2. input values of data members of object2 using set() 3. Your program should then display the price of costly car.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter11: Introduction To Classes
Section11.2: Basic Class Functions
Problem 5E
icon
Related questions
Question

PS : see image for question. 

Write a cpp program:
Design a class Car with two data members car ID, carPrice and following function members:
1. get() function to input values from user.
2. show() function to display values
3. set() function to set values of data members using input parameters
4. getPrice() function to return value of price
Now, you need to create two objects of your class and do the following:
1. input values of data members of object1 using get()
2. input values of data members of object2 using set()
3. Your program should then display the price of costly car.
Transcribed Image Text:Write a cpp program: Design a class Car with two data members car ID, carPrice and following function members: 1. get() function to input values from user. 2. show() function to display values 3. set() function to set values of data members using input parameters 4. getPrice() function to return value of price Now, you need to create two objects of your class and do the following: 1. input values of data members of object1 using get() 2. input values of data members of object2 using set() 3. Your program should then display the price of costly car.
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Multimedia tools and applications
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++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr