Create a password

Hi,

Have been trying to solve this problem and there’s no way I can solve it:

Help Elliott and the fSociety crew with a little pet project. Security is paramount to this group of anarchist rebels. And someone has to make sure that their hideout is not compromised.
The password to enter the Arcade has to be kept secure, and it changes every day. The first seven characters change every week, while the last ones are updated every day. The daily password is generated by appending to the weekly password the consonants of the day of the week we are in.
Your job is to create a piece of software that automatically updates the password every time a day goes by and print it.

Instructions

Having got the value of the weekly password stored in weeklyPass, update and print to the console the value of currentPass depending on the day of the week we are in. To know which day of the week it is simply access weekDay.
Remember that updating the password is appending the letters corresponding to the consonants present in the name of the current day of the week.
There are many ways of cracking this problem, but Elliot and the guys specifically asked for you to use a switch statement…

start with:

var weeklyPass = 'darlene';
var weekDay = 'friday';
var currentPass;

This is what I have been trying to make it work but gives this error message:

var weeklyPass = 'darlene';
var weekDay = 'friday';
var currentPass;

switch (weekDay) {
    case 'friday':
        currentPass = weeklyPass + 'frd';
        break;
    case 'saturday':
        currentPass = weelyPass +  'stdr';
        break;
    case 'sunday':
        currentPass = weeklyPass + 'snd';
        break;
    case 'monday': 
        currentPass = weeklyPass + 'mnd';
        break;
    case 'tuesday':
        currentPass = weeklyPass + 'tsd';
        break;
    case 'wednesday':
        currentPass = weeklyPass + 'wdnsd';
        break;
    case 'thursday':
        currentPass = weeklyPass + 'thrsd';
        break; 
}
console.log(currentPass);

ERROR MESSAGE: >>>>Code is incorrect
Your code is producing the wrong output. The password stored in currentPass is incorrect! Be sure your code works for all possible outcomes.

Help Pleaseeee

is y a vowel or consonant for this challenge?

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

Thanks a lot for you tips!

it is a vowel. you have any tips?

where does this challenge comes from?

your code seems correct. maybe with knowing how it’s tested, it’s possible to give you some hints

This is a pre work (between other challenges) that will allow me to have access to a programming course from academiadecodigo.org. Without it wont be allowed even to apply the course.
It is tested in their own website browser. :confused:

the only thing I can think of is the y

are there no more details to the error?

They say that Y is a vowel in this exercise.

If I try to play with variables I get different errors.
I am always on those errors instructed to use switch on the var weekDay, and to add the different possible cases if i try just with friday.
At the end I got to this error from where I cannot figure out why the output is wrong… why password stored in currentPass is wrong… and to be sure that code works for all possible outcomes… It does already, I believe!
Thats all info I have

check your saturday line

yes there an error missing the k on weeklyPass, fixed it but getting same error message output.


var weeklyPass = ‘darlene’;
var weekDay = ‘sunday’;
var currentPass;

switch (weekDay) {
case ‘friday’:
(currentPass = weeklyPass + ‘frd’);
break;
case ‘saturday’:
(currentPass = weeklyPass + ‘stdr’);
break;
case ‘sunday’:
(currentPass = weeklyPass + ‘snd’);
break;
case ‘monday’:
(currentPass = weeklyPass + ‘mnd’);
break;
case ‘tuesday’:
(currentPass = weeklyPass + ‘tsd’);
break;
case ‘wednesday’:
(currentPass = weeklyPass + ‘wdnsd’);
break;
case ‘thursday’:
(currentPass = weeklyPass + ‘thrsd’);
break;
}

console.log(currentPass);

// ‘y’ is a vowel in this case
// https://www.merriam-webster.com/words-at-play/why-y-is-sometimes-a-vowel-usage

Output

Code is incorrect

Your code is producing the wrong output. The password stored in currentPass is incorrect! Be sure your code works for all possible outcomes.

darlenesnd

check again your saturday line, still wrong, check it really carefully, letter by letter

YESSS! You were right! That was it. Thank you so much

just didnt manage to do this right (your text below) but next time will make it ok.

“I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.”

Helloo… did you figure it out? I am stuck haha