Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace Assignment
- {
- class Program
- {
- static void Main(string[] args)
- {
- //variable for the choice that the user will make on fuel type
- int choice, total, fuel1=fuel1-total = 100, fuel2 = 100, fuel3 = 100, total;
- do
- {
- //ask the user to select their required fuel
- Console.WriteLine("Please Pick The Number Of Your Fuel:");
- //choices that the user can choose between
- Console.WriteLine(" 1. Four Star Petrol");
- Console.WriteLine(" 2. Unleaded Petrol");
- Console.WriteLine(" 3. Diesel");
- choice = Convert.ToInt32(Console.ReadLine());
- if (choice == 1)
- {
- Console.WriteLine("Four Star Petrol");
- Console.WriteLine("How Much Fuel Do You Require?");
- total = Convert.ToInt32(Console.ReadLine());
- if (fuel1 - total < 0)
- {
- Console.WriteLine("Amount not avaliable");
- }
- else
- {
- Console.WriteLine("Please continue your transaction");
- Console.WriteLine("You selected: " + total + " litres of fuel type Four Star Petrol");
- }
- }
- if (choice == 2)
- {
- Console.WriteLine("Unleaded Petrol");
- Console.WriteLine("How Much Fuel Do You Require?");
- }
- if (choice == 3)
- {
- Console.WriteLine("Diesel");
- Console.WriteLine("How Much Fuel Do You Require?");
- }
- Console.ReadLine();
- }
- while ((choice < 3) && (choice > 0));
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement