Question please answer in Java 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 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 ( \( \mathrm{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 ' \( \mathrm{X} \) '. Refer to the sample run shown below to see how the tank is displayed. Refer to the sample run on the next pages. Gias Tank Control System Menus. 1. Fil Tank 3. Remove From Tank 4. Ehit \( \overline{\hat{H}} \) แnit is gdded. Gise Tank Control System Ment 1. Fill Tank 3. Show Tank \( \mathrm{X} \) Gas Tank Control System Menter 3: Fill Tank 5. Show Tank \( \overline{\bar{H}} \) แกit is added. Gas Tank Control System Menus il Tank 1. Fild Tank 3. Show Tank 4. Enit Tank Gias Tank Control System Menu menu 3. Fill Tank 3. Show tank Aे unit is added. Gas Tank Control System Mend 1." Fill Tank 3. Remove From Tank 3. Show Tank Gas Tank Control System Menus ill Tank 2. Remowe From Tank 4. Show Tank is full. Tank is full. The addition is disallowed.

OQKLTN The Asker · Computer Science

please answer in Java

Transcribed Image Text: 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 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 ( \( \mathrm{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 ' \( \mathrm{X} \) '. Refer to the sample run shown below to see how the tank is displayed. Refer to the sample run on the next pages. Gias Tank Control System Menus. 1. Fil Tank 3. Remove From Tank 4. Ehit \( \overline{\hat{H}} \) แnit is gdded. Gise Tank Control System Ment 1. Fill Tank 3. Show Tank \( \mathrm{X} \) Gas Tank Control System Menter 3: Fill Tank 5. Show Tank \( \overline{\bar{H}} \) แกit is added. Gas Tank Control System Menus il Tank 1. Fild Tank 3. Show Tank 4. Enit Tank Gias Tank Control System Menu menu 3. Fill Tank 3. Show tank Aे unit is added. Gas Tank Control System Mend 1." Fill Tank 3. Remove From Tank 3. Show Tank Gas Tank Control System Menus ill Tank 2. Remowe From Tank 4. Show Tank is full. Tank is full. The addition is disallowed.
More
Transcribed Image Text: 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 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 ( \( \mathrm{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 ' \( \mathrm{X} \) '. Refer to the sample run shown below to see how the tank is displayed. Refer to the sample run on the next pages. Gias Tank Control System Menus. 1. Fil Tank 3. Remove From Tank 4. Ehit \( \overline{\hat{H}} \) แnit is gdded. Gise Tank Control System Ment 1. Fill Tank 3. Show Tank \( \mathrm{X} \) Gas Tank Control System Menter 3: Fill Tank 5. Show Tank \( \overline{\bar{H}} \) แกit is added. Gas Tank Control System Menus il Tank 1. Fild Tank 3. Show Tank 4. Enit Tank Gias Tank Control System Menu menu 3. Fill Tank 3. Show tank Aे unit is added. Gas Tank Control System Mend 1." Fill Tank 3. Remove From Tank 3. Show Tank Gas Tank Control System Menus ill Tank 2. Remowe From Tank 4. Show Tank is full. Tank is full. The addition is disallowed.
Community Answer
MHBRAC

【General guidance】The answer provided below has been developed in a clear step by step manner.Step1/2include using namespace std;int main() { cout<<"Gas Tank Control System\n"; cout<<"Menu\n"; int opt; cout<<"1. Fill tank\n"; cout<<"2. Remove from tank\n"; cout<<"3. Show tank\n"; cout<<"4. Exit\n"; // select a option cin>>opt; stack tank; //eep repeating the process until the user selects the exit opion while(opt!=4) { if(opt==1) { if(tank.size()<3) { ... See the full answer