Question: C++ program. Write a Car class that has member variables tank and speed. Create a function called pumpGas. An exception has to be thrown when
Class Assignment 9 Due: July-11-2017 Name: Write the Car class that has tank and speed as member variables. If a negative value is passed to the furiction pumpGas, an exception must be thrown. Also if a value is passed that will make the value of tanik more than 15 another exception must be thrown. For example if you ask to pump 10 gallons of gas and you already have 8 gallons in the tank, so the exception that is thrown should indicate that you have asked for 3 extra gallons and the catch block should return 3 $4 $12 back to you
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
