Help. The if statement | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Help. The if statement

You are planning a vacation in August. You are given a program that takes the month as input. Task Complete the code to output "vacation", if the given month is August. Don't output anything otherwise. Sample Input August Sample Output vacation

11th Sep 2021, 8:04 AM
Jade Merabela Fabiaña
5 Answers
+ 5
Jade Merabela Fabiaña Just write var month = readLine ();
11th Sep 2021, 8:14 AM
A͢J
A͢J - avatar
+ 2
your attempt?
11th Sep 2021, 8:10 AM
Rellot's screwdriver
Rellot's screwdriver - avatar
+ 2
var month = parseInt(readLine(), 10) //your code goes here if (month == "August") { console.log ("vacation"); } what's wrong with this code can you tell please
11th Sep 2021, 8:13 AM
Jade Merabela Fabiaña
+ 2
solution : console.log(readLine()=='August'?'vacation':'') problem: Remove parseInt() it's convert string into int
11th Sep 2021, 10:26 AM
SAN
SAN - avatar
+ 1
i got it people thanks for helping me out!
11th Sep 2021, 4:32 PM
Jade Merabela Fabiaña