Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Program
- {
- //Declare constants
- const double STANDARD_A = 3.00, STANDARD_B = 5.00, STANDARD_SURCHARGE = 2.50;
- static void Main ()
- {
- //Declare string
- string Standard, A, B;
- //Declare variables
- double type, item, cost, surcharge, category, total_cost;
- //Ask user for what type of shipment, Standard, Express or SameDay
- //Store info as type
- Console.WriteLine("Please enter the type of shipping, Standard, Express or Same Day?");
- type = (Console.ReadLine());
- //Ask user for what category they need. A or B?")
- //Store info as category
- Console.WriteLine("Please enter the category this is to be shipped in, A or B?");
- category = (Console.ReadLine());
- //Write an if statement type = standard and category = A
- //Ask how many items they are shipping
- //Store as a variable called cost
- if (type = Standard && category = A)
- {
- //Ask user how many items they are shipping
- //Store answer as item
- Console.WriteLine("How many items are you shipping?");
- item = (Console.ReadLine());
- //Find the cost by item * STANDARD_A
- //Store as cost
- cost = int.Parse(item * STANDARD_A);
- //Ask user if this item is going to Alaska or Hawaii
- //store as surcharge
- Console.WriteLine("Is this package going to Hawaii or Alaska?");
- surcharge = (ConsoleReadline());
- error //If surcharge = yes then add surcharge to cost and store as total_cost
- //Print out total_cost
- if (surcharge = yes)
- {
- total_cost = (surcharge + cost);
- Console.WriteLine("This is the total cost {0}.",total_cost);
- }
- //Else surcharge = no then print only print our cost
- else (surcharge = No)
- {
- Console.WriteLine("This is the total cost {0}.", cost);
- }
- }
- //Else type = Standard and category = B then
- else (type = Standard && category = B)
- {
- }
- }
- }
Add Comment
Please, Sign In to add comment