Create a class named TESLA Demonstrate through a program - .create four public member variables: numerOf Doors, engineSize, modelName, msrpPrice and two private member variables: chassiNumber, vinNumber for this class • Demonstrate creation of three objects of this class by instantiating the objects with constructors Object 1: public variables: 4 door, 300kW, Tesla model 3, $46000 to $70000; private variables: abc123; 12345 • Object 2: public variables: 4 door, 600kW, Tesla model S, $99000 to 111000; private variables: xyz123; 45678 Object 3: public variables: 2 door, 1000kW, Tesla model Roadster, $200000; private variables: jfk123; 001 Create get and set functions for all the member variables • Create two additional functions for this class: . . . • A function that asks user input for a price range and based on that prints all four public variables: numer Of Doors, engineSize, modelName, msrpPrice Example: input: $100000 should print details of Tesla Model 3 and Model S. Example: input: $250000, should print details of all three models: Model 3, Model S, and Model Roadster Example input $40000 should print " There are no cars available in this price range. Please try a higher price range" Do not hard code the above values. What I given is examples. It should work for any price given by user • A function that asks user input in terms of engine size and prints chassiNumber, vinNumber . When you print values, print label for each of the values. Ex: number Of Doors: 4 door, engine Size: 400kW, model Name: Tesla Model 3, msrp Price: $46000 to $70000 • Create a default destructor function • Provide comments for each function. One line comment is sufficient .
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
Create a class named TESLA Demonstrate through a program - .create four public member variables: numerOf Doors, engineSize, modelName, msrpPrice and two private member variables: chassiNumber, vinNumber for this class • Demonstrate creation of three objects of this class by instantiating the objects with constructors Object 1: public variables: 4 door, 300kW, Tesla model 3, $46000 to $70000; private variables: abc123; 12345 • Object 2: public variables: 4 door, 600kW, Tesla model S, $99000 to 111000; private variables: xyz123; 45678 Object 3: public variables: 2 door, 1000kW, Tesla model Roadster, $200000; private variables: jfk123; 001 Create get and set functions for all the member variables • Create two additional functions for this class: . . . • A function that asks user input for a price range and based on that prints all four public variables: numer Of Doors, engineSize, modelName, msrpPrice Example: input: $100000 should print details of Tesla Model 3 and Model S. Example: input: $250000, should print details of all three models: Model 3, Model S, and Model Roadster Example input $40000 should print " There are no cars available in this price range. Please try a higher price range" Do not hard code the above values. What I given is examples. It should work for any price given by user • A function that asks user input in terms of engine size and prints chassiNumber, vinNumber . When you print values, print label for each of the values. Ex: number Of Doors: 4 door, engine Size: 400kW, model Name: Tesla Model 3, msrp Price: $46000 to $70000 • Create a default destructor function • Provide comments for each function. One line comment is sufficient .
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 4 images