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 _03
- {
- class Program
- {
- static void Main(string[] args)
- {
- double weight = double.Parse(Console.ReadLine());
- string type = Console.ReadLine();
- int distance = int.Parse(Console.ReadLine());
- var price = 0.00;
- var percent = 0.00;
- var allPrice = 0.00;
- if (type == "standart")
- {
- if (weight<1)
- {
- price = 0.03;
- }
- else if (weight >= 1 && weight <= 150)
- {
- price = 0.05;
- }
- else if (weight>=11 && weight<=40)
- {
- price = 0.10;
- }
- else if (weight >= 41 && weight <= 90)
- {
- price = 0.15;
- }
- else if (weight >= 91 && weight <= 150)
- {
- price = 0.20;
- }
- }
- else if (type == "express")
- {
- if (weight < 1)
- {
- price = 0.03;
- percent = 80 / 100;
- }
- else if (weight >= 1 && weight <= 150)
- {
- price = 0.05;
- percent = 40 / 100;
- }
- else if (weight >= 11 && weight <= 40)
- {
- price = 0.10;
- percent = 5 / 100;
- }
- else if (weight >= 41 && weight <= 90)
- {
- price = 0.15;
- percent = 2 / 100;
- }
- else if (weight >= 91 && weight <= 150)
- {
- price = 0.20;
- percent = 1 / 100;
- }
- }
- allPrice = (price * distance) + price * percent;
- Console.WriteLine($"The delivery of your shipment with weight of {weight:f3} kg. would cost {allPrice:f2} lv.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement