-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy path16. Q16.js
More file actions
35 lines (32 loc) · 952 Bytes
/
16. Q16.js
File metadata and controls
35 lines (32 loc) · 952 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
26
27
28
29
30
31
32
33
34
35
// 16. Check if the season is Autumn, Winter, Spring or Summer. If the user input is :
// - September, October or November, the season is Autumn.
// - December, January or February, the season is Winter.
// - March, April or May, the season is Spring
// - June, July or August, the season is Summer
const prompt = require("prompt-sync")({ sigint: true });
const month = prompt("Enter the month: ").toLowerCase();
switch (month) {
case "september":
case "october":
case "november":
console.log(`This is Autumn season`);
break;
case "december":
case "january":
case "february":
console.log(`This is Winter season`);
break;
case "march":
case "april":
case "may":
console.log(`This is Spring season`);
break;
case "june":
case "july":
case "august":
console.log(`This is Summer season`);
break;
default:
console.log(`Please Enter a correct name of the month`);
break;
}