CJCoding With Joseph
15free / daySign inCreate account

Vehicle has a constructor that takes a make and stores it in Make. Complete the Car constructor so it forwards make up to the base Vehicle constructor using : base(...), then stores doors in Doors. The tester builds a Car and prints its Make on the first line and its Doors on the second. Do NOT write a Main method.

For new Car("Toyota", 4) the program prints the output shown in Expected Output.

Expected output

Toyota
4

= newline. The output ends with a newline, so print one after the last line.

Hints2 available
Topics
Polymorphism
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (cw, cr, fori)

Your output

Run your code to see the output here...

Test cases

Run your code to see test case results.