Ok | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 2

Ok

Sundays in Switzerland are protected with Quiet Rules which make it illegal to pursue certain activities. Taking the day of the week as input, output to the console "Obey the rules" if it is Sunday. Sample Input Sunday Sample Output Obey the rules

8th Jan 2021, 4:03 PM
Darryl T. Davis
11 Answers
+ 7
You have to use '==' operator to compare two variables
8th Jan 2021, 5:18 PM
Simba
Simba - avatar
+ 2
If the day is not Sunday what will return? Which programming language you need help? Where's your attempt?
8th Jan 2021, 4:09 PM
The future is now thanks to science
The future is now thanks to science - avatar
+ 2
function main() { var day = readLine(); var rules = 'Obey the rules'; // Your code goes here if (day == 'Sunday') { console.log(rules); } }
12th Jul 2021, 6:01 PM
Aziz Ergashev
Aziz Ergashev - avatar
+ 1
thx I got it and I made it harder ghan it actually was if (day == ‘Sunday’) {console.log(rules); }
8th Jan 2021, 6:56 PM
Darryl T. Davis
0
issss that a code coach question?
8th Jan 2021, 4:07 PM
Rellot's screwdriver
Rellot's screwdriver - avatar
0
yes i guess im a beginner .
8th Jan 2021, 4:08 PM
Darryl T. Davis
0
heres what i did but only worked for one test case
8th Jan 2021, 4:09 PM
Darryl T. Davis
0
unction main() { var day = readLine(); var rules = 'Obey the rules'; // if day is Sunday: 'Obey the rules' var day = day var rules = 'Obey the rules'; if (day = 'Sunday'); { } console.log(rules);
8th Jan 2021, 4:10 PM
Darryl T. Davis
0
function main() { var day = readLine(); var rules = 'Obey the rules'; // Your code goes here if(day=='Sunday'){ console.log(rules); }
19th Aug 2021, 3:07 PM
Abdoul Aziz diallo
Abdoul Aziz diallo - avatar
0
function main() { var day = readLine(); var rules = 'Obey the rules'; // Your code goes here if (day == 'Sunday') { console.log(rules); } } Good Luck
25th Jan 2022, 7:46 AM
Muhammad Alif Deva Rizqon
Muhammad Alif Deva Rizqon - avatar
- 1
unction main() { var day = readLine(); var rules = 'Obey the rules'; // if day is Sunday: 'Obey the rules' var day = day var rules = 'Obey the rules'; if (day = 'Sunday'); { } console.log(rules); heres what i did bit only right gor one test case
8th Jan 2021, 4:08 PM
Darryl T. Davis