Explain the error in the following sample of Ruby code. Reference the line which the error is found on:
1- my_grade = "A+" 2- 3- if my_grade = "A+" 4- puts "PASSED!!!" 5- end
Explain the error in the following sample of Ruby code. Reference the line which the error is found on:
1- my_grade = "A+" 2- 3- if my_grade = "A+" 4- puts "PASSED!!!" 5- end
Explain the error in the following sample of Ruby code. Reference the line which the error is found on:
Please do your homework yourself rather than sending countless emails to the list with each of your assignments.
Fred
The obvious error is that if we do your work for you, you learn nothing.
Are you even trying to solve these? How are you studying Ruby to be posed these problems? If you’ve got classes then I’d suggest paying more attention in them; if you’re studying on your own, have you read all the materiel? I’m sure the answers have all been covered.
If you’re finding it difficult, then maybe the course is not for you, because if you were working on a real project, the problems are not so contrived, and the answers aren’t so obvious.
For this specific problem; consider (or Google) the difference between assignment and comparison operators in Ruby.