9/6/23, 12:27 PM Assessment 3: Attempt review
COS1511-23-Y Welcome to COS1511 Module Site Assessment 3
QUIZ
Started on Wednesday, 6 September 2023, 11:52 AM
State Finished
Completed on Wednesday, 6 September 2023, 12:25 PM
Time taken 33 mins 30 secs
Marks 58.00/60.00
Grade 96.67 out of 100.00
https://mymodules.dtls.unisa.ac.za/mod/quiz/review.php?attempt=13064786&cmid=738305 1/67
,9/6/23, 12:27 PM Assessment 3: Attempt review
Question 1 Which of the following statements declares a one-dimensional
Correct array called letters to contain the first five lowercase letters of
Mark 1.00 out of the alphabet.
1.00
a. char letters[5] = {'a', 'b', 'c', 'd', 'e'};
char letters[5] = {'a', 'b', 'c', 'd', 'e'};
b. char letters[5] = {"a", "b", "c", "d", "e"};
c. char letters[5] = {'a'; 'b'; 'c'; 'd'; 'e'};
d. char letters[5] = {"a"; "b"; "c"; "d"; "e"};
Your answer is correct.
The correct answer is:
char letters[5] = {'a', 'b', 'c', 'd', 'e'};
char letters[5] = {'a', 'b', 'c', 'd', 'e'};
https://mymodules.dtls.unisa.ac.za/mod/quiz/review.php?attempt=13064786&cmid=738305 2/67
,9/6/23, 12:27 PM Assessment 3: Attempt review
Question 2 Given the array declaration below and user prompt, which
Correct statement will place the number 1 into the first array element
Mark 1.00 out of using the extraction operator.
1.00
int numbers[5] = {0};
cout << “Enter the first number: “;
a. cin >> numbers[1];
b. cin >> numbers[0] + 1;
c. cin >> numbers[0] = 1;
d. cin >> numbers[0];
Your answer is correct.
The correct answer is:
cin >> numbers[0];
https://mymodules.dtls.unisa.ac.za/mod/quiz/review.php?attempt=13064786&cmid=738305 3/67
, 9/6/23, 12:27 PM Assessment 3: Attempt review
Question 3 You would use _____ to reference the variable located in the first
Correct row, first column of the scores two-dimensional array.
Mark 1.00 out of
1.00
a. scores[0][0]
b. scores[1][1]
c. scores[first][first]
d. scores[1,1]
Your answer is correct.
The correct answer is:
scores[0][0]
https://mymodules.dtls.unisa.ac.za/mod/quiz/review.php?attempt=13064786&cmid=738305 4/67
COS1511-23-Y Welcome to COS1511 Module Site Assessment 3
QUIZ
Started on Wednesday, 6 September 2023, 11:52 AM
State Finished
Completed on Wednesday, 6 September 2023, 12:25 PM
Time taken 33 mins 30 secs
Marks 58.00/60.00
Grade 96.67 out of 100.00
https://mymodules.dtls.unisa.ac.za/mod/quiz/review.php?attempt=13064786&cmid=738305 1/67
,9/6/23, 12:27 PM Assessment 3: Attempt review
Question 1 Which of the following statements declares a one-dimensional
Correct array called letters to contain the first five lowercase letters of
Mark 1.00 out of the alphabet.
1.00
a. char letters[5] = {'a', 'b', 'c', 'd', 'e'};
char letters[5] = {'a', 'b', 'c', 'd', 'e'};
b. char letters[5] = {"a", "b", "c", "d", "e"};
c. char letters[5] = {'a'; 'b'; 'c'; 'd'; 'e'};
d. char letters[5] = {"a"; "b"; "c"; "d"; "e"};
Your answer is correct.
The correct answer is:
char letters[5] = {'a', 'b', 'c', 'd', 'e'};
char letters[5] = {'a', 'b', 'c', 'd', 'e'};
https://mymodules.dtls.unisa.ac.za/mod/quiz/review.php?attempt=13064786&cmid=738305 2/67
,9/6/23, 12:27 PM Assessment 3: Attempt review
Question 2 Given the array declaration below and user prompt, which
Correct statement will place the number 1 into the first array element
Mark 1.00 out of using the extraction operator.
1.00
int numbers[5] = {0};
cout << “Enter the first number: “;
a. cin >> numbers[1];
b. cin >> numbers[0] + 1;
c. cin >> numbers[0] = 1;
d. cin >> numbers[0];
Your answer is correct.
The correct answer is:
cin >> numbers[0];
https://mymodules.dtls.unisa.ac.za/mod/quiz/review.php?attempt=13064786&cmid=738305 3/67
, 9/6/23, 12:27 PM Assessment 3: Attempt review
Question 3 You would use _____ to reference the variable located in the first
Correct row, first column of the scores two-dimensional array.
Mark 1.00 out of
1.00
a. scores[0][0]
b. scores[1][1]
c. scores[first][first]
d. scores[1,1]
Your answer is correct.
The correct answer is:
scores[0][0]
https://mymodules.dtls.unisa.ac.za/mod/quiz/review.php?attempt=13064786&cmid=738305 4/67