0
BallPark PLEASE help!!!
Please help me learn how to work with an array of strings in switch. what am i do wrong ? https://code.sololearn.com/cV3TGr0aeld2/?ref=app
1 Antwort
+ 3
There are a few issues with the code you provided:
1) The switch statement is trying to use the entire orders array as the input, but it should be using the individual elements of the array. You can do this by changing the switch statement to switch(orders[i]).
2) The for loop is only looping through the first 4 elements of the array, which may not be all the orders. You can change the loop to for(int i = 0; i < orders.Length; i++) to loop through all the elements of the array.