Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.06 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace Assignment
  7. {
  8. class Program
  9. {
  10. static void Main(string[] args)
  11. {
  12. //variable for the choice that the user will make on fuel type
  13. int choice, total, fuel1=fuel1-total = 100, fuel2 = 100, fuel3 = 100, total;
  14.  
  15.  
  16. do
  17. {
  18. //ask the user to select their required fuel
  19. Console.WriteLine("Please Pick The Number Of Your Fuel:");
  20. //choices that the user can choose between
  21. Console.WriteLine(" 1. Four Star Petrol");
  22. Console.WriteLine(" 2. Unleaded Petrol");
  23. Console.WriteLine(" 3. Diesel");
  24. choice = Convert.ToInt32(Console.ReadLine());
  25.  
  26. if (choice == 1)
  27. {
  28. Console.WriteLine("Four Star Petrol");
  29. Console.WriteLine("How Much Fuel Do You Require?");
  30. total = Convert.ToInt32(Console.ReadLine());
  31.  
  32. if (fuel1 - total < 0)
  33. {
  34. Console.WriteLine("Amount not avaliable");
  35. }
  36. else
  37. {
  38. Console.WriteLine("Please continue your transaction");
  39. Console.WriteLine("You selected: " + total + " litres of fuel type Four Star Petrol");
  40.  
  41. }
  42.  
  43. }
  44. if (choice == 2)
  45. {
  46. Console.WriteLine("Unleaded Petrol");
  47. Console.WriteLine("How Much Fuel Do You Require?");
  48. }
  49.  
  50. if (choice == 3)
  51. {
  52. Console.WriteLine("Diesel");
  53. Console.WriteLine("How Much Fuel Do You Require?");
  54. }
  55. Console.ReadLine();
  56. }
  57. while ((choice < 3) && (choice > 0));
  58.  
  59. Console.ReadLine();
  60. }
  61.  
  62. }
  63.  
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement