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 packageWeight = double.Parse(Console.ReadLine());
- string serviceType = Console.ReadLine().ToLower();
- double distance = double.Parse(Console.ReadLine());
- double price = 0.0;
- double price2 = 0.0;
- if (serviceType == "standard")
- {
- if (packageWeight < 1)
- {
- price = 0.03 * distance;
- }
- else if (packageWeight >= 1 && packageWeight <= 10)
- {
- price = 0.05 * distance;
- }
- else if (packageWeight >= 11 && packageWeight <= 40)
- {
- price = 0.1 * distance;
- }
- else if (packageWeight >= 41 && packageWeight <= 90)
- {
- price = 0.15 * distance;
- }
- else if (packageWeight >= 91 && packageWeight <= 150)
- {
- price = 0.2 * distance;
- }
- }
- else
- {
- if (packageWeight < 1)
- {
- price = 0.03 * distance;
- price2 = distance * (packageWeight * (0.15 * 0.8));
- }
- else if (packageWeight >= 1 && packageWeight <= 10)
- {
- price = 0.05 * distance;
- price2 = distance * (packageWeight * (0.15 * 0.4));
- }
- else if (packageWeight >= 11 && packageWeight <= 40)
- {
- price = 0.1 * distance;
- price2 = distance * (packageWeight * (0.15 * 0.05));
- }
- else if (packageWeight >= 41 && packageWeight <= 90)
- {
- price = 0.15 * distance;
- price2 = distance * (packageWeight * (0.15 * 0.02));
- }
- else if (packageWeight >= 91 && packageWeight <= 150)
- {
- price = 0.2 * distance;
- price2 = distance * (packageWeight * (0.15 * 0.01));
- }
- }
- double totalPrice = price + price2;
- Console.WriteLine($"The delivery of your shipment with weight of {packageWeight:F3} kg. would cost {totalPrice:F2} lv.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement