SAMPLE OUTPUT: ~~~~~ ~~ Character Skills Chart Enter Avatar Name: Korra Enter skills scores (0-50) Strength: 45 Agility: 37 Speed: 29 Endurance: 16 Korra's skills chart. Strength: Agility: Speed:...


c++


SAMPLE OUTPUT:<br>~~~~~<br>~~<br>Character Skills Chart<br>Enter Avatar Name: Korra<br>Enter skills scores (0-50)<br>Strength: 45<br>Agility: 37<br>Speed: 29<br>Endurance: 16<br>Korra's skills chart.<br>Strength:<br>Agility:<br>Speed:<br>Endurance:<br>============><br>======><br>=====><br>=====><br>Enter Avatar Name: Roku<br>Enter skills scores (0-50)<br>Strength: 37<br>Agility: 47<br>Speed: 28<br>Endurance: 33<br>Roku's skills chart.<br>Strength:<br>Agility:<br>Speed:<br>==><br>=====><br>=======><br>Endurance:<br>======><br>

Extracted text: SAMPLE OUTPUT: ~~~~~ ~~ Character Skills Chart Enter Avatar Name: Korra Enter skills scores (0-50) Strength: 45 Agility: 37 Speed: 29 Endurance: 16 Korra's skills chart. Strength: Agility: Speed: Endurance: ============> ======> =====> =====> Enter Avatar Name: Roku Enter skills scores (0-50) Strength: 37 Agility: 47 Speed: 28 Endurance: 33 Roku's skills chart. Strength: Agility: Speed: ==> =====> =======> Endurance: ======>
Question 3<br>Answer this question using ONLY ONE .cpp file.<br>Write a complete program based on the following requirements and sample output given.<br>(a) Create constant global variable GLOBAL_CONST with value 4.<br>(b) Create a class named Skills with the following members:<br>i.<br>Private data members:<br>• A float type array score with 4 elements<br>• A string type array name with 4 elements<br>ii.<br>Public member functions:<br>• A default constructor that sets the elements of name[i] with these strings:<br>

Extracted text: Question 3 Answer this question using ONLY ONE .cpp file. Write a complete program based on the following requirements and sample output given. (a) Create constant global variable GLOBAL_CONST with value 4. (b) Create a class named Skills with the following members: i. Private data members: • A float type array score with 4 elements • A string type array name with 4 elements ii. Public member functions: • A default constructor that sets the elements of name[i] with these strings: "Strength" • Declare class Avatar as a friend "Agility" "Speed" "Endurance" (c) Create a class name Avatar with the following members: i. Private data members: • A string type variable name • A Skills class object s ii. Public member functions: • void setName(...) This function receives a string value from main() as argument and sets to the name data member • void setSkills() This function displays the "Enter skills scores (0-50)" and then prompts the user to enter the scores for each skill as shown in the sample output, and store in the score array of s. Note: You can use a for loop to loop through the elements of name[i] to print the skill names and score[i] to set their scores in s. • string getName() Accessor function to return name. • void displayChart() This function displays the scores in a chart form, as shown in the sample output. Note: You can use nested loops to do the display. The outer loop to go through the name[i] of s to print the skill names, then the inner loop to go through the score[i] values of s to print out the symbol "=". (d) In the main(): i. Declare variables wherever necessary. Create an array object of class Avatar with 2 elements. Display the "Character Skills Chart" header. Use a loop: • Prompt the user to enter their Avatar's name. • Call setName(...) of the object array element with the user entered name as ii. iii. iv. argument. • Call setSkills() and displayChart()functions of the object array element.
Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here