Advertisement
Valantina

SeaTrip/SampleExam

Jun 12th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.88 KB | None | 0 0
  1. using System;
  2.  
  3. namespace SeaTrip
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             double moneyForFoodEachDay = double.Parse(Console.ReadLine());
  10.             double moneyForSouvenirsEachDay = double.Parse(Console.ReadLine());
  11.             double moneyForHotel = double.Parse(Console.ReadLine());
  12.             double km = 420;
  13.             double petrol = (km / 100) * 7;
  14.             petrol *= 1.85;
  15.             double rest = 3 * moneyForFoodEachDay + 3 * moneyForSouvenirsEachDay;
  16.             double firstDayDiscount = moneyForHotel * 0.9;
  17.             double secondDayDiscount = moneyForHotel * 0.85;
  18.             double thirdDayDiscount = moneyForHotel * 0.8;
  19.             double total = petrol + firstDayDiscount + secondDayDiscount + thirdDayDiscount + rest;
  20.             Console.WriteLine($"Money needed: {total:f2}");
  21.  
  22.         }
  23.     }
  24.    
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement