Advertisement
Niicksana

Photo Pictures

Dec 13th, 2017
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.75 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 _3.Photo_Pictures
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             // Exam - 03 September 2017
  14.             int photos = int.Parse(Console.ReadLine());
  15.             string size = Console.ReadLine().ToLower();
  16.             string onlineOfline = Console.ReadLine();
  17.  
  18.             double price = 0;
  19.             double discaunt = 1;
  20.             if (size == "9x13")
  21.             {
  22.                 price = 0.16;
  23.  
  24.                 if (photos >= 50)
  25.                 {
  26.                     discaunt = 0.95;
  27.                 }
  28.             }
  29.             else if (size == "10x15")
  30.             {
  31.                 price = 0.16;
  32.  
  33.                 if (photos >= 80)
  34.                 {
  35.                     discaunt = 0.97;
  36.                 }
  37.             }
  38.  
  39.             else if (size == "13x18")
  40.             {
  41.                 price = 0.38;
  42.  
  43.                 if (photos >= 50 && photos <= 100)
  44.                 {
  45.                     discaunt = 0.97;
  46.                 }
  47.  
  48.                 else
  49.                 {
  50.                     discaunt = 0.95;
  51.                 }
  52.             }
  53.  
  54.             else
  55.             {
  56.                 price = 2.90;
  57.  
  58.                 if (photos >= 10 && photos <= 50)
  59.                 {
  60.                     discaunt = 0.93;
  61.                 }
  62.  
  63.                 else
  64.                 {
  65.                     discaunt = 0.91;
  66.                 }
  67.             }
  68.  
  69.             double sum = photos * price * discaunt;
  70.  
  71.             if (onlineOfline == "online")
  72.             {
  73.                 sum *= 0.98;
  74.             }
  75.  
  76.             Console.WriteLine("{0:f2}BGN", sum);
  77.         }
  78.     }
  79. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement