Advertisement
Guest User

Untitled

a guest
Oct 12th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.19 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace Paper_Problem
  7. {
  8. class Program
  9. {
  10. static void Main(string[] args)
  11. {
  12. int reportlength = 140;
  13. int meetingmembers = 25;
  14. int ream = 500;
  15. int paperneeded = (meetingmembers + 5) * reportlength;
  16. float reamsneeded = (paperneeded / 500) + 1;
  17. int cartridgesneeded = (paperneeded / 1200) + 1;
  18. Console.WriteLine("You need a total of {0} reams of paper and {1} ink cartridges.", reamsneeded, cartridgesneeded);
  19. string userInput;
  20. int cartridgecount;
  21. int reamcount;
  22. Console.WriteLine("How many Ink cartridges would you like to buy?");
  23. userInput = Console.ReadLine();
  24. cartridgecount = Int32.Parse(userInput);
  25. Console.WriteLine("How many reams of paper would you like to buy?");
  26. userInput = Console.ReadLine();
  27. reamcount = Int32.Parse(userInput);
  28. double reamcost = 49.99;
  29. double cartridgecost = 12.99;
  30. double cartridgetotal = cartridgecount * cartridgecost;
  31. double reamtotal = reamcost * reamcount;
  32. double totalcost = reamtotal + cartridgetotal;
  33.  
  34. if (cartridgecount >= 5 && reamcount >= 5)
  35. {
  36. double discounttotal = totalcost / 10;
  37. double discountsaved = totalcost - discounttotal;
  38. Console.WriteLine("{0} Total", discounttotal);
  39. Console.WriteLine("{0} Ink Cartridges {1}", cartridgecount, cartridgecost);
  40. Console.WriteLine("{0} Reams of paper {1}", reamcount, reamcost);
  41. Console.WriteLine("You have saved a total of {0}", discountsaved);
  42. Console.ReadLine();
  43. }
  44. else
  45. {
  46. Console.WriteLine("{0} Total", totalcost);
  47. Console.WriteLine("{0} Ink Cartridges {1}", cartridgecount, cartridgecost);
  48. Console.WriteLine("{0} Reams of paper {1}", reamcount, reamcost);
  49. Console.ReadLine();
  50. }
  51.  
  52. }
  53. }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement