Advertisement
bacco

Фото снимки; Photo Pictures

Feb 9th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.87 KB | None | 0 0
  1. using System;
  2.  
  3. namespace tESt
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             var numPhotos = int.Parse(Console.ReadLine());
  10.             var typePhotos = Console.ReadLine().ToLower();  //  "9X13" , "10X15" , "13X18" , "20X30"
  11.             var orderType = Console.ReadLine().ToLower();   //  "online" , "office"
  12.  
  13.             double priceBGL = 0;
  14.  
  15.             if (typePhotos == "9x13")
  16.             {
  17.                 priceBGL = numPhotos * 0.16;
  18.  
  19.                 if (numPhotos >= 50)
  20.                 {
  21.                     priceBGL = priceBGL * 0.95;
  22.                 }
  23.                
  24.             }
  25.             else if (typePhotos == "10x15")
  26.             {
  27.                 priceBGL = numPhotos * 0.16;
  28.  
  29.                 if (numPhotos >= 80)
  30.                 {
  31.                     priceBGL = priceBGL * 0.97;
  32.                 }
  33.             }
  34.             else if (typePhotos == "13x18")
  35.             {
  36.                 priceBGL = numPhotos * 0.38;
  37.  
  38.                 if (numPhotos >= 50  && numPhotos <= 100)
  39.                 {
  40.                     priceBGL = priceBGL * 0.97;
  41.  
  42.                 }
  43.                 else if (numPhotos > 100)
  44.                 {
  45.                     priceBGL = priceBGL * 0.95;
  46.                 }
  47.             }
  48.             else if (typePhotos == "20x30")
  49.             {
  50.                 priceBGL = numPhotos * 2.90;
  51.  
  52.                 if (numPhotos >= 10 && numPhotos <= 50)
  53.                 {
  54.                     priceBGL = priceBGL * 0.93;
  55.  
  56.                 }
  57.                 else if (numPhotos > 50)
  58.                 {
  59.                     priceBGL = priceBGL * 0.91;
  60.                 }
  61.             }
  62.  
  63.             if (orderType == "online")
  64.             {
  65.                 priceBGL = priceBGL * 0.98; // 2% online order
  66.             }
  67.  
  68.             Console.WriteLine($"{priceBGL:f2}BGN");
  69.         }
  70.     }
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement