How can i fix the errors? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
5th Apr 2020, 12:07 PM
Icebreaker
Icebreaker - avatar
5 Answers
+ 1
- you declared mark2 as a double and you're using it next as an array mark2[i]. - you defined the method to return int but the return is of type string ("A+" is a string) so the the method should be : string checkGrade(). * switch () can't be a float. it has to be int or char or enum
5th Apr 2020, 12:48 PM
Bahhaⵣ
Bahhaⵣ - avatar
+ 1
Thanks
5th Apr 2020, 4:13 PM
Icebreaker
Icebreaker - avatar
0
are you trying to check multiple grades or just one?
5th Apr 2020, 12:50 PM
Bahhaⵣ
Bahhaⵣ - avatar
0
Just one
5th Apr 2020, 1:41 PM
Icebreaker
Icebreaker - avatar
0
if only one grade, better get rid of for loop it's useless, and mark2 variable just use mark1 as it's passed to the method. then use if else statements instead of switch. it doesn't have to be that complicated.
5th Apr 2020, 1:54 PM
Bahhaⵣ
Bahhaⵣ - avatar