Guest User

Untitled

a guest
Dec 11th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.05 KB | None | 0 0
  1. using System;
  2.  
  3.  
  4. class Program
  5. {
  6. //Declare constants
  7. const double STANDARD_A = 3.00, STANDARD_B = 5.00, STANDARD_SURCHARGE = 2.50;
  8. static void Main ()
  9. {
  10. //Declare string
  11. string Standard, A, B;
  12. //Declare variables
  13. double type, item, cost, surcharge, category, total_cost;
  14.  
  15. //Ask user for what type of shipment, Standard, Express or SameDay
  16. //Store info as type
  17. Console.WriteLine("Please enter the type of shipping, Standard, Express or Same Day?");
  18. type = (Console.ReadLine());
  19.  
  20. //Ask user for what category they need. A or B?")
  21. //Store info as category
  22. Console.WriteLine("Please enter the category this is to be shipped in, A or B?");
  23. category = (Console.ReadLine());
  24.  
  25. //Write an if statement type = standard and category = A
  26. //Ask how many items they are shipping
  27. //Store as a variable called cost
  28. if (type = Standard && category = A)
  29. {
  30. //Ask user how many items they are shipping
  31. //Store answer as item
  32. Console.WriteLine("How many items are you shipping?");
  33. item = (Console.ReadLine());
  34.  
  35. //Find the cost by item * STANDARD_A
  36. //Store as cost
  37. cost = int.Parse(item * STANDARD_A);
  38.  
  39. //Ask user if this item is going to Alaska or Hawaii
  40. //store as surcharge
  41. Console.WriteLine("Is this package going to Hawaii or Alaska?");
  42. surcharge = (ConsoleReadline());
  43.  
  44. error //If surcharge = yes then add surcharge to cost and store as total_cost
  45. //Print out total_cost
  46. if (surcharge = yes)
  47. {
  48. total_cost = (surcharge + cost);
  49. Console.WriteLine("This is the total cost {0}.",total_cost);
  50. }
  51.  
  52. //Else surcharge = no then print only print our cost
  53. else (surcharge = No)
  54. {
  55. Console.WriteLine("This is the total cost {0}.", cost);
  56. }
  57. }
  58.  
  59. //Else type = Standard and category = B then
  60. else (type = Standard && category = B)
  61.  
  62. {
  63.  
  64. }
  65.  
  66.  
  67. }
  68.  
  69. }
Add Comment
Please, Sign In to add comment