Guest User

Untitled

a guest
Dec 11th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. /*************
  2. * Generate the 3 random numbers 3 different ways.
  3. * Seeded, milliseconds, cpu cycles
  4. * Seeded includes asking the user what month they were born and prompting them to enter a number 0 - 11.
  5. * Based on their entry, the program will generate a seed using the following code as a base:
  6. *
  7. * int numDays = 0;
  8. * switch(months){
  9. * case 0: case 2: case 4: case 6: case 7: case 9: case 11:
  10. * numDays = 31;
  11. * break;
  12. * case 3: case 5: case 8: case 10:
  13. * numDays = 30;
  14. * break;
  15. * case 1:
  16. * if (((years % 4 ==0) && !(years % 100 == 0)) || (years % 400 == 0))
  17. * numDays = 29;
  18. * else
  19. * numDays = 28;
  20. * break;
  21. * default:
  22. * numDays = 31;
  23. * break;
  24. * }
  25. */
Add Comment
Please, Sign In to add comment