Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _02._Safari
- {
- class Program
- {
- static void Main(string[] args)
- {
- double budget = double.Parse(Console.ReadLine());
- double gasNeeded = double.Parse(Console.ReadLine());
- string dayOfTheWeek = Console.ReadLine();
- double totalWorth = gasNeeded * 2.10 + 100;
- if (dayOfTheWeek == "Sunday")
- {
- totalWorth *= 0.80;
- }
- else
- {
- totalWorth *= 0.90;
- }
- if (budget >= totalWorth)
- {
- Console.WriteLine($"Safari time! Money left: {budget - totalWorth:f2} lv.");
- }
- else
- {
- Console.WriteLine($"Not enough money! Money needed: { Math.Abs(budget - totalWorth):f2} lv.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement