Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Courier_Express
- {
- class Program
- {
- static void Main(string[] args)
- {
- double kg = double.Parse(Console.ReadLine());
- string type = Console.ReadLine();
- double km = double.Parse(Console.ReadLine());
- var money = 0.0;
- var addOn = 0.0;
- if (type == "standart")
- {
- if (kg < 1)
- {
- money = 0.03;
- }
- else if (kg >= 1 && kg <= 10)
- {
- money = 0.05;
- }
- else if (kg >= 11 && kg <=40)
- {
- money = 0.1;
- }
- else if (kg >= 41 && kg <= 90)
- {
- money = 0.15;
- }
- else
- {
- money = 0.20;
- }
- }
- if (type == "express")
- {
- if (kg < 1)
- {
- money = 0.03;
- addOn = 0.8;
- }
- else if (kg >= 1 && kg <= 10)
- {
- money = 0.05;
- addOn = 0.4;
- }
- else if (kg >= 11 && kg <= 40)
- {
- money = 0.1;
- addOn = 0.05;
- }
- else if (kg >= 41 && kg <= 90)
- {
- money = 0.15;
- addOn = 0.02;
- }
- else
- {
- money = 0.20;
- addOn = 0.01;
- }
- }
- if (type == "express")
- {
- var neshto = km * money;
- var random = addOn * money;
- var random1 = kg * random;
- var random2 = km * random1;
- var price = neshto + random2;
- Console.WriteLine($"The delivery of your shipment with weight of {kg:f3} kg. would cost {price:f2} lv.");
- }
- else
- {
- var price = km * money;
- Console.WriteLine($"The delivery of your shipment with weight of {kg:f3} kg. would cost {price:f2} lv.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement