Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. int difference, year=0, industry = 0, industrytwo = 0, industry1value=0, industry2value=0;
  2. printf("Please select year from 2011 to 2016.\n");
  3. scanf_s("%d", &year);
  4. printf("Please select industry.\n 1: Construction\n 2: Manufacturing\n 3: Marine\n 4: Transportation & Storage\n 5: Water Supply & Sewerage\n 6: Whole sale & Retail\n");
  5. scanf_s("%d", &industry);
  6. printf("hello");
  7. if (industry == 1)
  8. {
  9. industry1value = con[year - 2011];
  10. }
  11. else if (industry == 2)
  12. {
  13. industry1value = man[year - 2011];
  14. }
  15. else if (industry == 3)
  16. {
  17. industry1value = marine[year - 2011];
  18. }
  19. else if (industry == 4)
  20. {
  21. industry1value = TS[year - 2011];
  22. }
  23. else if (industry == 5)
  24. {
  25. industry1value = WSS[year - 2011];
  26. }
  27. else if (industry == 6)
  28. {
  29. industry1value = WSR[year - 2011];
  30. }
  31. printf("Please select industry.\n 1: Construction\n 2: Manufacturing\n 3: Marine\n 4: Transportation & Storage\n 5: Water Supply & Sewerage\n 6: Whole sale & Retail\n");
  32.  
  33.  
  34.  
  35. scanf_s("%d", &industrytwo);
  36.  
  37.  
  38.  
  39. printf("hello");
  40. if (industrytwo == 1)
  41. {
  42. industry2value = con[year - 2011];
  43. }
  44. else if (industrytwo == 2)
  45. {
  46. industry2value = man[year - 2011];
  47. }
  48. else if (industrytwo == 3)
  49. {
  50. industry2value = marine[year - 2011];
  51. }
  52. else if (industrytwo == 4)
  53. {
  54. industry2value = TS[year - 2011];
  55. }
  56. else if (industrytwo == 5)
  57. {
  58. industry2value = WSS[year - 2011];
  59.  
  60. }
  61. else if (industrytwo == 6)
  62. {
  63. industry2value = WSR[year - 2011];
  64.  
  65. }
  66.  
  67. difference = industry2value - industry1value;
  68. printf("Difference is %d.\n", difference);
  69.  
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement