Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Safari
- {
- class Program
- {
- static void Main(string[] args)
- {
- double budget = double.Parse(Console.ReadLine());
- double fuel = double.Parse(Console.ReadLine());
- string day = Console.ReadLine();
- double fuelPrice = fuel * 2.10;
- double gid = 100;
- double totalPrice = fuelPrice + gid;
- if (day == "Saturday")
- {
- totalPrice = totalPrice * 0.10;
- }
- else if (day == "Sunday")
- {
- totalPrice = totalPrice * 0.20;
- }
- double result = totalPrice - budget;
- if (totalPrice <= budget)
- {
- Console.WriteLine($"Safari time! Money left: {result:F2} lv. ");
- }
- else if (totalPrice > budget)
- {
- Console.WriteLine($"Not enough money! Money needed: {result:F2} lv.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement