vendredi 29 septembre 2017

How to figure out future date in java

I have a assignment to do that calls for a user picking a date from 0-6 (zero being Sunday, 1 is Monday, and 6 is Saturday. etc) and then they pick a number of days that elapsed from that day. For example if the user put in today was 3 (which is Wednesday) and 2 days elapsed which makes it Friday I do not understand how to code that or figure out an equation to apply the elapsed days to the 0-6 week. If someone was to enter in 15 instead of a small number I would know what day that would be in my head from simple addition but I cant transfer that to my code.

Note: I am importing Scanner class for the user input.

Aucun commentaire:

Enregistrer un commentaire