-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFutureDay.java
More file actions
29 lines (24 loc) · 1 KB
/
FutureDay.java
File metadata and controls
29 lines (24 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import java.util.Scanner;
public class FutureDay {
public static void main(String[] args) {
System.out.println("What day is it today?");
System.out.println("Enter 0 for Sunday" +
"\n 1 for Monday" +
"\n 2 for Tuesday" +
"\n 3 for Wednesday" +
"\n 4 for Thursday" +
"\n 5 for Friday" +
"\n 6 for Saturday");
System.out.print("\ntoday: ");
Scanner scanner = new Scanner(System.in);
int presentDay = scanner.nextInt();
System.out.println("You entered: "+presentDay);
System.out.println("how many days into the future? ");
int daysIntoTheFuture = scanner.nextInt();
System.out.println("You entered: " + daysIntoTheFuture);
int futureDay= (presentDay + daysIntoTheFuture)%7;
System.out.println("In " + daysIntoTheFuture +
" days it will be day " + futureDay);
scanner.close();
}
}