-
Notifications
You must be signed in to change notification settings - Fork 0
/
tempCodeRunnerFile.java
37 lines (28 loc) · 1.23 KB
/
tempCodeRunnerFile.java
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
30
31
32
33
34
35
36
37
import java.util.Scanner;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
public class Meeting_scheduler {
public static void main(String[] args) {
String response;
int days;
String time;
//Display the date and time
LocalDateTime currDateTime = LocalDateTime.now();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("E ,MMM dd yyyy h:mm a");
System.out.println(formatter.format(currDateTime));
Scanner input = new Scanner(System.in);
System.out.println("Would you like to schedule a meeting? (Yes/No)");
response = input.nextLine();
if (response == "Yes"){//you can still use response.equals("Yes")
System.out.println("Enter the number of days to the meeting(e.g. 2,3..): ");
days = input.nextInt();
System.out.println("What time will the meeting be?(24-hour format hh:mm) ");
time = input.nextLine();
LocalDateTime meetingDate = currDateTime.plusDays(days);
System.out.println("Your meeting is scheduled for " + formatter.format(meetingDate) + time);
}
else{
System.out.println("Have a nice day ahead!");
}
}
}