Advertisement
simonradev

First

Apr 30th, 2017
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.57 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace HousePrice
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             //            •   Първия ред – площта на най - малката стая – реално число в интервала[1.00...100.00]
  14.             //•   Втория ред – площта на кухнята – реално число в интервала[1.00...100.00]
  15.             //•   Третия ред – цена на квадратен метър – реално число в интервала[1.00...1000.00]
  16.  
  17.             double smallestRoomArea = double.Parse(Console.ReadLine());
  18.             double kitchenArea = double.Parse(Console.ReadLine());
  19.             double pricePerSquareMeter = double.Parse(Console.ReadLine());
  20.  
  21.             double secondRoomArea = smallestRoomArea * 1.1;
  22.             double thirdRoomArea = secondRoomArea * 1.1;
  23.             double bathroom = smallestRoomArea / 2;
  24.  
  25.             double areaWithoutCorridor = smallestRoomArea +
  26.                                             secondRoomArea +
  27.                                             thirdRoomArea +
  28.                                             bathroom +
  29.                                             kitchenArea;
  30.  
  31.             double totalArea = areaWithoutCorridor * 1.05;
  32.  
  33.             double priceForTotalArea = totalArea * pricePerSquareMeter;
  34.  
  35.             Console.WriteLine($"{priceForTotalArea:f2}");
  36.         }
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement