Question Assume that a local gas station has asked you to create a "Gas Tank Control System" which allows their clerks to manage gas on a tank based on their occupancies. Note: The code submitted must be your own work, otherwise; it won't be graded. You may continue to use the code we did in class to continue your implementation. Submission: Submit your Java file on Blackboard by the due date. Try your best to accomplish the tasks as much as possible. The operations include: 1. Fill Tank 2. Remove From Tank 3. Show Tanks 4. Exit The requirements are as followed. 1. One stack must be constructed. 2. Use character ' \( X \) ' as an item added to the stack. 3. The four operations must be repeated until the "Exit" option is chosen. 4. A unit of gas (X) must be added to the tank. The limitation of the tank is three units. If the tank is full and the clerk tries to add a unit to the gas tank, the system must disallow the addition and display an appropriate message. (See the sample run for the message). 5. To remove, the system must remove a unit from the tank. If the tank is empty and the clerk tries to remove a unit from the gas tank, the system must disallow the removal and display an appropriate message. (See the sample run for the message). 6. The system must allow the clerk to view occupancy of the gas tank at any time. The unit of the gas must be displayed from the bottom of the tank. If any unit of the tank is empty, the system displays a blank instead of ' \( X \) '. Refer to the sample run shown below to see how the tank is displayed. Refer to the sample run on the next pages.

EKFKNK The Asker · Computer Science

Transcribed Image Text: Assume that a local gas station has asked you to create a "Gas Tank Control System" which allows their clerks to manage gas on a tank based on their occupancies. Note: The code submitted must be your own work, otherwise; it won't be graded. You may continue to use the code we did in class to continue your implementation. Submission: Submit your Java file on Blackboard by the due date. Try your best to accomplish the tasks as much as possible. The operations include: 1. Fill Tank 2. Remove From Tank 3. Show Tanks 4. Exit The requirements are as followed. 1. One stack must be constructed. 2. Use character ' \( X \) ' as an item added to the stack. 3. The four operations must be repeated until the "Exit" option is chosen. 4. A unit of gas (X) must be added to the tank. The limitation of the tank is three units. If the tank is full and the clerk tries to add a unit to the gas tank, the system must disallow the addition and display an appropriate message. (See the sample run for the message). 5. To remove, the system must remove a unit from the tank. If the tank is empty and the clerk tries to remove a unit from the gas tank, the system must disallow the removal and display an appropriate message. (See the sample run for the message). 6. The system must allow the clerk to view occupancy of the gas tank at any time. The unit of the gas must be displayed from the bottom of the tank. If any unit of the tank is empty, the system displays a blank instead of ' \( X \) '. Refer to the sample run shown below to see how the tank is displayed. Refer to the sample run on the next pages.
More
Transcribed Image Text: Assume that a local gas station has asked you to create a "Gas Tank Control System" which allows their clerks to manage gas on a tank based on their occupancies. Note: The code submitted must be your own work, otherwise; it won't be graded. You may continue to use the code we did in class to continue your implementation. Submission: Submit your Java file on Blackboard by the due date. Try your best to accomplish the tasks as much as possible. The operations include: 1. Fill Tank 2. Remove From Tank 3. Show Tanks 4. Exit The requirements are as followed. 1. One stack must be constructed. 2. Use character ' \( X \) ' as an item added to the stack. 3. The four operations must be repeated until the "Exit" option is chosen. 4. A unit of gas (X) must be added to the tank. The limitation of the tank is three units. If the tank is full and the clerk tries to add a unit to the gas tank, the system must disallow the addition and display an appropriate message. (See the sample run for the message). 5. To remove, the system must remove a unit from the tank. If the tank is empty and the clerk tries to remove a unit from the gas tank, the system must disallow the removal and display an appropriate message. (See the sample run for the message). 6. The system must allow the clerk to view occupancy of the gas tank at any time. The unit of the gas must be displayed from the bottom of the tank. If any unit of the tank is empty, the system displays a blank instead of ' \( X \) '. Refer to the sample run shown below to see how the tank is displayed. Refer to the sample run on the next pages.
Community Answer
8SFIPF

【General guidance】The answer provided below has been developed in a clear step by step manner.Step1/1includeusing namespace std;int main(){ cout<>opt; stack tank; //keep repeating the process until the user selects the exit opion while(opt! ... See the full answer