-1
BS: I’m using a learning platform, I’m trying to decipher what’s wrong. I’ll leave the question below and my code. In the city amusement park, they installed a new roller coaster and asked us for help so that we could notify people, whether they could get in or not, before queuing up. The requirements for a person to be able to enter the toy are: edit1: the system itself provides the variables.
Reach a height of at least 1,5 m (or 1,2 m if accompanied by an adult) Not having any heart problem Set the podeSubir function, receiving 3 parameters: highPessoa (number), timeCompania (boolean), temProblemaCardiaco (boolean), return true or false as appropriate. Take into account the necessary conditions mentioned above.
codeline:
function podeSubir(alturaPessoa, vemComCompania, temProblemaCardiaco){
return alturaPessoa >= 1.5 && temProblemaCardiaco == !temProblemaCardiaco || alturaPessoa >= 1.2 && vemComCompania == vemComCompania && temProblemaCardiaco == !temProblemaCardiaco ;
}
this code does not supply some tests, but even I hammering still will not. if you can help...
Can you explain to us:
temProblemaCardiaco == !temProblemaCardiaco
?– Woss
as the system itself provides the values, so I only used the parameter to buy itself as a form of negation
– Bruno Nevaska
And when a value is equal to itself denied?
– Woss
good question, on second thought, but this was just an attempt before several, I used without the exclamation but sainda will not
– Bruno Nevaska
Okay, so I understand that you’re trying to write code without understanding what the code does, which is a serious mistake, so I recommend you do the table test of your solution and see exactly what it does.
– Woss
Remember that you can use the karnaugh map to build your logical expression.
– Woss
thanks for the guidance!!!
– Bruno Nevaska