How come in the error list it says: 'numberOfPeople': unreferenced local variable 'topChoiceTotal': unreferenced local variable Unintialized local variable 'rating' used How can I fix it? :( | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How come in the error list it says: 'numberOfPeople': unreferenced local variable 'topChoiceTotal': unreferenced local variable Unintialized local variable 'rating' used How can I fix it? :(

char rating; string favoriteSnack ; int numberOfPeople; int topChoiceTotal; favoriteSnack = "crackers"; rating = 'B'; numberOfPeople = '250'; topChoiceTotal = '148';

27th Feb 2017, 1:36 AM
Luke Mai
Luke Mai - avatar
1 Answer
+ 1
As numberOfPeople and topChoiceTotal are int variables, you should assign the value without single quotes... Just like this numberOfPeople=250;
27th Feb 2017, 2:24 AM
Alejandro Serrato
Alejandro Serrato - avatar