Answered step by step
Verified Expert Solution
Question
1 Approved Answer
A teacher put three bonus questions on a test and awarded 5 extra points to anyone who answered all three bonus questions correctly and no
A teacher put three bonus questions on a test and awarded extra points to anyone who answered all three bonus questions correctly and no extra points otherwise. Assume that the boolean variables bonusOne, bonusTwo, and bonusThree indicate whether a student has answered the particular question correctly. Each variable was assigned true if the answer was correct and false if the answer was incorrect.
Which of the following code segments will properly update the variable grade based on a student's performance on the bonus questions?
I if bonusOnetrue && bonusThreetrue
grade ;
II if bonusOnetrue bonusThreetrue
grade
III if bonusOnetrue
grade ;
if bonusTwotrue
grade ;
if bonusThreetrue
grade
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started