Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Next year, Big Blue Madness will use a lottery number to select individuals who

ID: 3801937 • Letter: N

Question

Next year, Big Blue Madness will use a lottery number to select individuals who can receive Big Blue Madness tickets. While the event is free, the fans can purchase special souvenirs. People will register to have their names in the lottery and can also preorder souvenirs.

Code only the statements requested for the given question.

The value assigned to the variable numberOfTickets depends on the value of the lotteryNumber variable. Write only the if ... else statement that will assign to the numberOfTickets variable the value of 1 if the lotteryNumber is less or equal to 100 otherwise assign the value of 2 to the variable numberOfTickets.

Explanation / Answer

Here is the requested if...else statement

//if lotteryNumber is less than or equal to 100 set numberOfTickets to 1
       if(lotteryNumber<=100)
           numberOfTickets=1;
       //else set numberOfTickets to 2
       else
           numberOfTickets=2;

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote