Part (1)Define a class with the following specifications: a. The class name is FuelTank with three private data members: - content (double): represents the tank capacity measured in liter. b. Define a private method called : represents fuel level if its low or not usured in liter. i. Step 1: compute the fuel percentage asevel() that does the following boolean (true or false) ii. Step 2: update the Fuel Percentage follows: otherwise, lowI the private lowLevel c. Define a constructor that accepts be false variable to true if the fuel percentage is less than 10% , capacity and content private data members capacity and content as input parameters to initialize the d. Define a public method called upers and call the method defined in part (b) to update lowLevel parameter (it might be either positive or fuelContent ( ) that accepts fuelAmount (double) as input i. Step 1: Add the fuelAmount to content data The method does the following steps: ii. Step 2: In case the new value of content exceeds capacity, set content to capacity. iv. Step 4: update the lowr value of content becomes negative, set content to Zero. e. Provide an accessor (get) method variable by calling the method defined in (b) data member. 2w Level data member and a mutator (set) method for capacity below:

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
Part (1)Define a class with the following specifications: a. The class name is FuelTank with three private data members: - content (double): represents the tank capacity measured in liter. b. Define a private method called : represents fuel level if its low or not usured in liter. i. Step 1: compute the fuel percentage asevel() that does the following boolean (true or false) ii. Step 2: update the Fuel Percentage follows: otherwise, lowI the private lowLevel c. Define a constructor that accepts be false variable to true if the fuel percentage is less than 10% , capacity and content private data members capacity and content as input parameters to initialize the d. Define a public method called upers and call the method defined in part (b) to update lowLevel parameter (it might be either positive or fuelContent ( ) that accepts fuelAmount (double) as input i. Step 1: Add the fuelAmount to content data The method does the following steps: ii. Step 2: In case the new value of content exceeds capacity, set content to capacity. iv. Step 4: update the lowr value of content becomes negative, set content to Zero. e. Provide an accessor (get) method variable by calling the method defined in (b) data member. 2w Level data member and a mutator (set) method for capacity below:
Expert Solution
steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
Class
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
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,