SHARE
TWEET

Untitled

a guest Dec 14th, 2019 96 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. namespace exerricsee
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.  
  10.             double months = int.Parse(Console.ReadLine());
  11.             double percent = int.Parse(Console.ReadLine());
  12.             double rent = double.Parse(Console.ReadLine());
  13.  
  14.             double firstPeriod = months / 2;
  15.             double secondPeriod = months - firstPeriod;
  16.  
  17.             double firstPeriodPrice = firstPeriod * rent;
  18.             double secondPeriodPrice = secondPeriod * (rent * 0.80);
  19.  
  20.             double price = firstPeriodPrice + secondPeriodPrice;
  21.             double broker = price * (percent / 100);
  22.                
  23.             double totalPrice = price + broker;
  24.  
  25.             Console.WriteLine($"Total: {totalPrice:f2}");
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.         }
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.     }
  41. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top