Advertisement
Guest User

Ne raboti

a guest
Dec 16th, 2017
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.60 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 Courier_Express
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             double kg = double.Parse(Console.ReadLine());
  14.             string type = Console.ReadLine();
  15.             double km = double.Parse(Console.ReadLine());
  16.             var money = 0.0;
  17.             var addOn = 0.0;
  18.  
  19.             if (type == "standart")
  20.             {
  21.                 if (kg < 1)
  22.                 {
  23.                     money = 0.03;
  24.                     addOn = 0.8;
  25.                 }
  26.                 else if (kg >= 1 && kg <= 10)
  27.                 {
  28.                     money = 0.05;
  29.                     addOn = 0.4;
  30.                 }
  31.                 else if (kg >= 11 && kg <= 40)
  32.                 {
  33.                     money = 0.1;
  34.                     addOn = 0.05;
  35.                 }
  36.                 else if (kg >= 41 && kg <= 90)
  37.                 {
  38.                     money = 0.15;
  39.                     addOn = 0.02;
  40.                 }
  41.                 else
  42.                 {
  43.                     money = 0.20;
  44.                     addOn = 0.01;
  45.                 }
  46.             }
  47.  
  48.             var neshto = km * money;
  49.            
  50.  
  51.             if (type == "express")
  52.             {
  53.                 neshto += km * addOn * kg;
  54.                
  55.             }        
  56.                          
  57.                 Console.WriteLine($"The delivery of your shipment with weight of {kg:f3} kg. would cost {neshto:f2} lv.");
  58.            
  59.         }
  60.     }
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement