Advertisement
Guest User

Untitled

a guest
Apr 19th, 2018
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. /******************************************************************************
  2. Carmen Henriquez
  3. Offset Calculator - MDC
  4. Econolite
  5. *******************************************************************************/
  6.  
  7. #include <stdio.h>
  8. int asset = 0;
  9. int yr = 0;
  10. int twosplit = 0;
  11. int sixsplit = 0;
  12. int cl = 0;
  13. int offset = 0;
  14. int x = 0;
  15. int y = 0;
  16.  
  17. int main()
  18. {
  19. //printf("Enter Asset:");
  20. //scanf("%d", &asset);
  21. //printf("you entered: %d\n", asset);
  22.  
  23. printf("Enter Yellow + Red:");
  24. scanf("%d", &yr);
  25.  
  26. printf("Enter Phase 2 Split time:");
  27. scanf("%d", &twosplit);
  28.  
  29. printf("Enter Phase 6 Split time:");
  30. scanf("%d", &sixsplit);
  31.  
  32. printf("Enter Cycle Length:");
  33. scanf("%d", &cl);
  34.  
  35. printf("Enter Offset:");
  36. scanf("%d", &offset);
  37.  
  38. twosplit = twosplit - yr;
  39. sixsplit = sixsplit - yr;
  40.  
  41. if(twosplit > sixsplit){
  42. x = (offset - twosplit);
  43. }
  44. else
  45. x = (offset - sixsplit);
  46.  
  47. printf("\nRO=%d\n", offset);
  48. printf("PH2=%d\n", twosplit);
  49. printf("PH6=%d\n", sixsplit);
  50.  
  51. if(x<0){
  52. y = cl + x;
  53. printf("NO=%d", y);
  54. }
  55.  
  56. else{
  57. printf("NO=%d", x);
  58. }
  59.  
  60. return 0;
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement