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;
- class GradeSwitch
- {
- static void Main()
- {
- Console.Write("Enter delivery type (X: Express|R:Regular) : ");
- string t = (Console.ReadLine());
- if (t == "R" || t == "E")
- {
- if (t == "R")
- {
- Console.Write("Enter weight of book (kilograms) : ");
- int x = int.Parse(Console.ReadLine());
- if (x > 0)
- {
- if (0 <= x * 1000 && x * 1000 <= 2000) { Console.WriteLine("You have to pay {0:f2} bt. for sending {1} Type with {2:f2} kilograms", ((x * 1000) * 0.25), t, x); }
- if (2000 < x * 1000 && x * 1000 <= 5000) { Console.WriteLine("You have to pay {0:f2} bt. for sending {1} Type with {2:f2} kilograms", (((2 * 1000) * 0.25)) + ((x - 2) * 1000 * 0.35), t, x); }
- if (x * 1000 > 5000) { Console.WriteLine("You have to pay {0:f2} bt. for sending {1} Type with {2:f2} kilograms", (((2 * 1000) * 0.25)) + (((3 * 1000) * 0.35)) + ((x - 5) * 1000 * 0.45), t, x); }
- }
- else { Console.WriteLine("Invalid Weight"); }
- }
- if (t == "E")
- {
- Console.Write("Enter weight of book (kilograms) : ");
- int x = int.Parse(Console.ReadLine());
- if (x > 0)
- {
- if (0 <= x * 1000 && x * 1000 <= 2000) { Console.WriteLine("You have to pay {0:f2} bt. for sending {1} Type with {2:f2} kilograms", ((x * 1000) * 0.25) + 50, t, x); }
- if (2000 < x * 1000 && x * 1000 <= 5000) { Console.WriteLine("You have to pay {0:f2} bt. for sending {1} Type with {2:f2} kilograms", (((2 * 1000) * 0.25)) + ((x - 2) * 1000 * 0.35) + 50, t, x); }
- if (x * 1000 > 5000) { Console.WriteLine("You have to pay {0:f2} bt. for sending {1} Type with {2:f2} kilograms", (((2 * 1000) * 0.25)) + (((3 * 1000) * 0.35)) + ((x - 5) * 1000 * 0.45) + 50, t, x); }
- }
- else { Console.WriteLine("Invalid Weight"); }
- }
- }
- else { Console.WriteLine("Invalid Type"); }
- Console.ReadLine();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement