Answer:
Following code will store the largest value in array parkingTickets in the variable mostTickets
mostTickets = parkingTickets[0];
for(int k = 0; k<parkingTickets.length; k++)
{
if(parkingTickets[i]>mostTickets)
{
mostTickets = parkingTickets[i];
}
}
Explanation:
In the above code segment, initially the number of tickets at first index is assumed as largest value of tickets in array.
Then using a for loop each value in the array parkingTickets is compared with the current mostTickets value.
If the compared value in parkingTickets array is larger than the current mostTickets value. Then that value is assigned to mostTickets.
This process is repeated for all elements in array.
Thus after looping through each element of array the largest value in array will get stored in mostTickets variable.
Answer:
a
Explanation:
your answer is the first one
Answer:
Option (B) is the correct answer to the following questions.
Explanation:
The following option is correct because the binary scope operator is used to define the global variable only when the local variable has also the same name and we want to use global variable also or we also use scope operate when we do not want to use any function inside the class.
The following option (A) is wrong because we not always required binary scope operator and the option (C) is wrong because we cannot use the scope operator anywhere and the option (d) is already wrong because that binary scope operator would not be used in the function prototype.
Answer:
I dont think I can answer this