Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Fuel_Tank___Part_2
- {
- class Program
- {
- static void Main(string[] args)
- {
- double benzin = 2.22;
- double dizel = 2.33;
- double gaz = 0.93;
- double discountBenzin = 0.18;
- double discountDizel = 0.12;
- double discountGaz = 0.08;
- string fuel = Console.ReadLine();
- double liters = double.Parse(Console.ReadLine());
- string clubCard = Console.ReadLine();
- double price = 0;
- double totalPrice = 0;
- bool clubCardd = false;
- if (clubCard == "Yes")
- {
- clubCardd = true;
- }
- else
- {
- clubCardd = false;
- }
- switch (fuel)
- {
- case
- "Gasoline":
- price = benzin - discountBenzin;
- break;
- case
- "Diesel":
- price = dizel - discountDizel;
- break;
- case
- "Gas":
- price = gaz - discountGaz;
- break;
- }
- if (clubCard == "No")
- {
- switch (fuel)
- {
- case "Gasoline":
- price = benzin;
- break;
- case "Diesel":
- price = dizel;
- break;
- case "Gas" :
- price = gaz;
- break;
- }
- }
- if (liters >= 25)
- {
- totalPrice = liters * price - ((10 * price)/100);
- }
- else if (liters >= 20)
- {
- totalPrice = liters * price - ((8 * price) / 100);
- }
- else
- {
- totalPrice = liters * price;
- }
- Console.WriteLine($"{totalPrice:f2} lv.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement