a) Declare a Car class that can be used to define automobile fuel efficiency and fuel level. The declaration must include functions that can: • Define manufacturer's stated efficieney and initial fuel...


a) Declare a Car class that can be used to define automobile fuel efficiency and fuel level.<br>The declaration must include functions that can:<br>• Define manufacturer's stated efficieney and initial fuel level.<br>• Define efficiency based on the user's specification.<br>• Update the fuel level based on input to the tank.<br>• Update the fuel level based on distance driven and efficiency.<br>• Output fuel volume in tank.<br>b) Define all functions of the class declared in part (a).<br>Note: Fuel consumed is determined by the distance travelled (in Km) multipled by<br>the efficiency.<br>c) Complete the programme by:<br>• Writing a main function that declares two car objects, myBenz and myJag. Both cars<br>should start with the same fuel level, however one should use the manufacturer's<br>efficiency rating and the other the user's efficiency specification.<br>• Adding 20 Litres of fuel to cach tank and output the fuel level after a 50Km drive for<br>both cars.<br>

Extracted text: a) Declare a Car class that can be used to define automobile fuel efficiency and fuel level. The declaration must include functions that can: • Define manufacturer's stated efficieney and initial fuel level. • Define efficiency based on the user's specification. • Update the fuel level based on input to the tank. • Update the fuel level based on distance driven and efficiency. • Output fuel volume in tank. b) Define all functions of the class declared in part (a). Note: Fuel consumed is determined by the distance travelled (in Km) multipled by the efficiency. c) Complete the programme by: • Writing a main function that declares two car objects, myBenz and myJag. Both cars should start with the same fuel level, however one should use the manufacturer's efficiency rating and the other the user's efficiency specification. • Adding 20 Litres of fuel to cach tank and output the fuel level after a 50Km drive for both cars.

Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here