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 5 and higher receive 50 bonus points for clearing any 5 levels in a day and an extra 30 points if those levels include the challenging Boss Level. Players below level 5 receive 30 bonus points for clearing any 3 levels in a day and an additional 20 points if at least one of those levels is a Puzzle Level.
Task: Write a set of nested if/else 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.
Goal: Execute lines of code conditionally

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!