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!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
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 Resposta
+ 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