Question: Getters and Setters Die Given the class : class DieRoll { public: int GetRoll() { return roll; } private: int roll =0; ; Drag and


Getters and Setters Die Given the class : class DieRoll \{ public: int GetRoll() \{ return roll; \} private: int roll =0; ; Drag and rearrange the code blocks below to create a setter that validates if the rolled number is between 1 and 6 inclusive. If it is, will be updated to the number that is rolled. You MUST include AT LEAST ONE access modifier in your code. Hint: Not all of the code blocks will be used. Also note that indentation has been disabled for this particular assessment. You will have ONE ATTEMPT at this assessment. Drag from here private: public: \} \} void SetRoll(new_roll) \{ void SetRoll(int new_roll) \{ int SetRoll(int new_roll) \{ roll = new_roll; if (new_roll >0&& new_roll
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
