Advertisement
Sim0o0na

01. Sea Trip

Apr 30th, 2018
886
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.70 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Exam
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             double foodMoney = double.Parse(Console.ReadLine());
  10.             double souvenirMoney = double.Parse(Console.ReadLine());
  11.             double hotelMoney = double.Parse(Console.ReadLine());
  12.  
  13.             double sumForTransport = (420.0 / 100.0) * 7 * 1.85;
  14.             double foodAndSouvenir = 3 * foodMoney + 3 * souvenirMoney;
  15.             double sumForStay = hotelMoney * 0.9 + hotelMoney * 0.85 + hotelMoney * 0.8;
  16.  
  17.             double totalSum = sumForTransport + foodAndSouvenir + sumForStay;
  18.             Console.WriteLine($"Money needed: {totalSum:f2}");
  19.         }
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement