Advertisement
IvanBorisovG

PhotoPictures

Sep 5th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.59 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 PhotoPictures
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int picturesCount = int.Parse(Console.ReadLine());
  14.             string picturesType = Console.ReadLine().ToLower();
  15.             string orderType = Console.ReadLine().ToLower();
  16.  
  17.             string type1 = "9x13";
  18.             string type2 = "10x15";
  19.             string type3 = "13x18";
  20.             string type4 = "20x30";
  21.             string orderTypeOnline = "online";
  22.             string orderTypeOffice = "office";
  23.             bool elseIfType3 = picturesType == type3 && picturesCount >= 50 && picturesCount <= 100 || picturesCount > 100;
  24.             bool elseIftype4 = picturesType == type4 && picturesCount >= 10 && picturesCount <= 50 || picturesCount > 50;
  25.             double price = 0.0;
  26.  
  27.             if (picturesType == type1 && picturesCount >= 50)
  28.             {
  29.                 price += (picturesCount * 0.16) * 0.95;
  30.                 if (orderType == orderTypeOnline)
  31.                 {
  32.                     price *= 0.98;
  33.                 }
  34.             }          
  35.             else if (picturesType == type2 && picturesCount >= 80)
  36.             {
  37.                 price += (picturesCount * 0.16) * 0.97;
  38.                 if (orderType == orderTypeOnline)
  39.                 {
  40.                     price *= 0.98;
  41.                 }
  42.             }
  43.             else if (picturesType == type3 && picturesCount >= 50 && picturesCount <= 100)
  44.             {
  45.                 price += (picturesCount * 0.38) * 0.97;
  46.                 if (orderType == orderTypeOnline)
  47.                 {
  48.                     price *= 0.98;
  49.                 }
  50.             }
  51.             else if (picturesType == type3 && picturesCount > 100)
  52.             {
  53.                 price += (picturesCount * 0.38) * 0.95;
  54.                 if (orderType == orderTypeOnline)
  55.                 {
  56.                     price *= 0.98;
  57.                 }
  58.             }
  59.             else if (picturesType == type4 && picturesCount >= 10 && picturesCount <= 50)
  60.             {
  61.                 price += (picturesCount * 2.90) * 0.93;
  62.                 if (orderType == orderTypeOnline)
  63.                 {
  64.                     price *= 0.98;
  65.                 }
  66.             }
  67.             else if (picturesType == type4 && picturesCount > 50)
  68.             {
  69.                 price += (picturesCount * 2.90) * 0.91;
  70.                 if (orderType == orderTypeOnline)
  71.                 {
  72.                     price *= 0.98;
  73.                 }
  74.             }
  75.             else
  76.             {
  77.                 if (picturesType == type1 || picturesType == type2)
  78.                 {
  79.                     price += picturesCount * 0.16;
  80.                     if (orderType == orderTypeOnline)
  81.                     {
  82.                         price *= 0.98;
  83.                     }
  84.                 }
  85.                 else if (picturesType == type3)
  86.                 {
  87.                     price += picturesCount * 0.38;
  88.                     if (orderType == orderTypeOnline)
  89.                     {
  90.                         price *= 0.98;
  91.                     }              
  92.                 }
  93.                 else if (picturesType == type4)
  94.                 {
  95.                     price += picturesCount * 2.90;
  96.                     if (orderType == orderTypeOnline)
  97.                     {
  98.                         price *= 0.98;
  99.                     }
  100.                 }
  101.             }
  102.             Console.WriteLine($"{price:f2}BGN");
  103.         }
  104.     }
  105. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement