-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDeliveryDate.java
More file actions
25 lines (25 loc) · 819 Bytes
/
DeliveryDate.java
File metadata and controls
25 lines (25 loc) · 819 Bytes
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
import java.time.*;
import java.util.Scanner;
public class DeliveryDate
{
public static void main (String [] args)
{
Scanner input = new Scanner(System.in);
LocalDate orderDate;
int mo;
int day;
int year;
final int WEEKS_FOR_DELIVERY = 2;
System.out.print("Enter order month: ");
mo = input.nextInt();
System.out.print("Enter order day: ");
day = input.nextInt();
System.out.print("Enter order year: ");
year = input.nextInt();
orderDate = LocalDate.of(year, mo, day);
System.out.println("==============================");
System.out.println("Order date is >> " + orderDate);
System.out.println("Delivery date is >> " +
orderDate.plusWeeks(WEEKS_FOR_DELIVERY));
}
}