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();
- bool clubCardd = true;
- if (fuel == "Gas")
- {
- if (clubCardd)
- {
- double price = gaz - discountGaz;
- double totalPrice = price * liters;
- double endPrice = totalPrice - (0.1 * totalPrice);
- Console.WriteLine($"{endPrice:f2} lv.");
- }
- }
- else if (fuel == "Gasoline")
- {
- double totalPrice = liters * benzin;
- double endPrice = totalPrice - (0.08 * totalPrice);
- Console.WriteLine($"{endPrice:f2} lv.");
- }
- else if (fuel == "Diesel")
- {
- double totalPrice = liters * dizel;
- Console.WriteLine($"{totalPrice:f2} lv.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment