Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. What are some of the things from your favorite game that you could represent

ID: 3666793 • Letter: 1

Question

1. What are some of the things from your favorite game that you could represent as objects? What might their data members and member functions be?
2. What are the advantages of using an array over a group of individual variables?
3. What are some limitations imposed by a fixed array size?
4. What are the advantages and disadvantages of operator overloading?
5. What kinds of games could you create using string objects, arrays, and for loops as your main tools? 1. What are some of the things from your favorite game that you could represent as objects? What might their data members and member functions be?
2. What are the advantages of using an array over a group of individual variables?
3. What are some limitations imposed by a fixed array size?
4. What are the advantages and disadvantages of operator overloading?
5. What kinds of games could you create using string objects, arrays, and for loops as your main tools?
2. What are the advantages of using an array over a group of individual variables?
3. What are some limitations imposed by a fixed array size?
4. What are the advantages and disadvantages of operator overloading?
5. What kinds of games could you create using string objects, arrays, and for loops as your main tools?

Explanation / Answer

3)

#include <iostream>

using namespace std;

int main()

{

int numbers[5];//This is a fixed array of 5 memory slots.

cout<< "Enter A Number";

cin >> numbers[0];//Filled Number 1

cout<< "Enter A Number";

cin >> numbers[1]; // filled number 2

cout<< "Enter A Number";

cin >>numbers[2];// filled number 3

cout<< "Enter A Number";

cin >> numbers[3];//filled number 4

cout<< "Enter A Number";

cin >> numbers [4];//filled number 5

cout<< "Enter A Number";

cin >> numbers [5];/* Error:: No Space allocated (This is becoz it is the 6th number) And the compiler set a space for 5 numbers and the 6th number has no space ..

*/

for (int n=0; n<=6;n++)

{

cout<< number[n]<<" ";

}

return 0;

}