IT MUST BE RUNNING LIKE A GASOLINE MACHINE FROM 0.0 TO THE SPECIFIC LITER NEEDED, AND ALSO THE PRICE MUST BE STARTING TO 0 TO THE SPECIFIC PRICE NEEDED.
#include <iostream>
#include <string>
using namespace std;
void main()
{
double ltr,price,liter;
char choice;
cout<<"\t\t\t\tMY GAS\n\n"<<endl;
cout<<"What type of Gasoline Fuel would you like to select?\n";
cout<<"[1] - Unleaded Fuel\n";
cout<<"[2] - Premium Fuel\n";
cout<<"[3] - Diesel Fuel\n";
cout<<"choice: ";
cin>>choice;
system("CLS");
if (choice=='1')
{
cout<<"\t\t\t\tMY GAS\n\n"<<endl;
cout<<"Which of the following do you want to input?\n";
cout<<"[a] - PRICE\n";
cout<<"[b] - LITER\n";
cout<<"Choice: " ;
cin>>choice;
system("CLS");
if (choice=='a')
{
cout<<"\t\t\t\tMY GAS\n\n"<<endl;
cout<<"Enter the price: ";
cin>>price;
ltr=(price/40)*1;
cout<<"Unleaded purchased in litres: "<<ltr<<endl<<endl;
}
else if(choice=='b')
{
cout<<"\t\t\t\tMY GAS\n\n"<<endl;
cout<<"Enter your liter: ";
cin>>liter;
ltr=(liter*40);
cout<<"The price for the Unleaded will be: "<<ltr<<endl;
}
else
{
system("CLS");
cout<<"\t\t\t\tMY GAS\n\n"<<endl;
cout<<"Invalid Input!"<<endl<<endl<<endl;
}
}
if (choice=='2')
{
cout<<"\t\t\t\tMY GAS\n\n"<<endl;
cout<<"Which of the following do you want to input?\n";
cout<<"[a] - PRICE\n";
cout<<"[b] - LITER\n";
cout<<"Choice: " ;
cin>>choice;
system("CLS");
if (choice=='a')
{
cout<<"\t\t\t\tMY GAS\n\n"<<endl;
cout<<"Enter the price: ";
cin>>price;
ltr=(price/35)*1;
cout<<"Premium purchased in litres: \n"<<ltr<<endl;
}
else if(choice=='b')
{
cout<<"\t\t\t\tMY GAS\n\n"<<endl;
cout<<"Enter your liter: ";
cin>>liter;
ltr=(liter*35);
cout<<"The price for the Premium will be: \n"<<ltr<<endl;
}
cout<<"\t\t\t\tMY GAS\n\n"<<endl;
cout<<"Which of the following do you want to input?\n";
cout<<"[a] - PRICE\n";
cout<<"[b] - LITER\n";
cout<<"Choice: " ;
cin>>choice;
system("CLS");
if (choice=='a')
{
cout<<"\t\t\t\tMY GAS\n\n"<<endl;
cout<<"Enter the price: ";
cin>>price;
ltr=(price/30)*1;
cout<<"Diesel purchased in litres: "<<ltr<<endl;
}
else if(choice=='b')
{
cout<<"\t\t\t\tMY GAS\n\n"<<endl;
cout<<"Enter your liter: ";
cin>>liter;
ltr=(liter*30);
cout<<"The price for the Diesel will be: \n"<<ltr<<endl;
}
else
{
system("CLS");
cout<<"\t\t\t\tMY GAS\n\n"<<endl;
cout<<"Invalid Input!"<<endl<<endl<<endl;
}
}