Question: Goal: Execute lines of code conditionally Assignment: In a gaming app, players earn rewards based on their player level and the number of levels they
Goal: Execute lines of code conditionally
Assignment: In a gaming app, players earn rewards based on their player level and the number of levels they clear in a day. Depending on the level, players earn different rewards. Players level and higher receive bonus points for clearing any levels in a day and an extra points if those levels include the challenging Boss Level. Players below level receive bonus points for clearing any levels in a day and an additional points if at least one of those levels is a Puzzle Level.
Task: Write a set of nested ifelse statements that assigns bonusPoints the appropriate value depending on:
the int variables playerLevel and levelsCleared;
the bool variables clearedBossLevel and clearedPuzzleLevel.
Note: Assume all the variables have been declared and initialized. You only need to write the nested if structure that assigns the correct value to bonusPoints.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
