Save
Upgrade to remove ads
Busy. Please wait.
Log in with Clever
or

show password
Forgot Password?

Don't have an account?  Sign up 
Sign up using Clever
or

Username is available taken
show password


Make sure to remember your password. If you forget it there is no way for StudyStack to send you a reset link. You would need to create a new account.
Your email address is only used to allow you to reset your password. See our Privacy Policy and Terms of Service.


Already a StudyStack user? Log In

Reset Password
Enter the associated with your account, and we'll email you a link to reset your password.
focusNode
Didn't know it?
click below
 
Knew it?
click below
Don't Know
Remaining cards (0)
Know
0:00
Embed Code - If you would like this activity on your web page, copy the script below and paste it into your web page.

  Normal Size     Small Size show me how

CP2

Module 2 Formative Assessment

QuestionAnswer
What is the index number of the last element of an array with 9 elements? 8
What is the index number of the last element of an array with 100 elements? 99
In C++, an Array is: All statements describes array
What is the output of the following code? #include <iostream> using namespace std; int main() { char grade[] = {'A','B','C'}; int n = grade[0]; cout << "GRADE = " << grade[0] << " " << n ; return 0; } GRADE = A 65
What will be the output of the following C++ code? #include <iostream> using namespace std; int main() { char str[] = "ABCDE"; for (int i = 0 ; i<3;i++ ) { cout << str[i]; } return 0; } ABC
Which of the following gives the memory address of the first element in an array? array
What is the index number of the last element of an array with 50 elements? 49
What is the output of the following code? #include <iostream> using namespace std; int main() { int a[] = {1,2,3,4}; int b[] = {5,6,7,8}; cout << a[0] << " " << b[0]; return 0; } 1 5
If an array can store 10 values, what would be its last index? 9
What is the correct array declaration? int arr2[15];
In order to have an array with 50 rows and 2 columns, the correct declaration should be: int x[50][2];
What is the output of the program? #include <iostream> using namespace std; int main() { int a[2][2] = {{1,2},{3,4}}; int i, j; for (i = 0; i < 2; i++) for (j = 0; j < 2; j++) cout << a[i][j]; return 0; } 1234
Check the array below: int array[3][5] { { 1, 2, 3, 4, 5 }, { 6, 7, 8, 9, 10 }, { 11, 12, 13, 14, 15 } }; What’s the index of the array where it contains the value 14? array [2][3]
If you are going to create a 10x10 array named myTable, what would be your declaration? int myTable[10][10];
In the array is int x[5][6], how many columns were created? 6
In order to have an array with 11 rows and 13 columns, the correct declaration should be: x[11][13]
In the array is int x[4][5], how many columns were created? 5
In a given array int x[3][4] = {{0,1,2,3}, {4,5,6,7}, {8,9,10,11}}; how many columns are there? 4
If the array has a syntax of data_type array_name[x][y]; What does x represent? rows
If an array myArray = {15, 45, 67, 34, 34}, what statement should you choose to change the 3rd element to 3? myArray[2] = 3;
Which of the following accesses the seventh element stored in an array? array[6];
What will be the output of the following C++ code? #include<iostream> using namespace std; int main () { int array[] = {0, 2, 4, 6, 7, 5, 3}; int n, result = 0; for (n = 0; n < 8; n++) { result += array[n]; } cout << result; return 0; } 27
What is the output of the program? #include <iostream> using namespace std; int main() { int myArray[] = {2,4,6,8,10,12}; for (int i = 0; i<6; i++) { cout << myArray[i] << " "; } } 2 4 6 8 10 12
What is the output of the program? #include <iostream> using namespace std; int main() { int myArray[] = {1,2,3,4,5,6}; for (int i = 0; i<6; i++) { cout << myArray[i] << " "; } } 1 2 3 4 5 6
What is the output of the following code? #include <iostream> using namespace std; int main() { char grade[] = {'A','B','C'}; cout << "GRADE = " << grade[0]; return 0; } GRADE = A
Which of the following correctly accesses the seventh element stored in an array named box with 100 elements? box[6];
What is the output of the following code? #include <iostream> using namespace std; int main() { double marks[3] = {90.5, 92.5, 96.5}; int a=0; while(a<3) { cout << marks[a] << " "; a++; } return 0; } 90.5 92.5 96.5
In the array is int x[100][50], how many columns were created? 50
In order to have an array with 2 rows and 1 column, the correct declaration should be: int x[2][1];
In the array is int x[3][4], how many columns were created? 4
Which of the following is a two-dimensional array? int myArray[13][11];
What is the output of the given program? #include <iostream> using namespace std; int main() { int a[2][2] = {{2,4},{6,8}}; int i, j; for (i = 0; i < 2; i++) for (j = 0; j < 2; j++) cout << a[i][j] << " "; return 0; } 2 4 6 8
In the array is int x[100][50], how many rows were created? 100
If the array has a syntax of data_type array_name[x][y]; What does y represent? columns
In the array is int x[10][6], how many columns were created? 6
What is the output of the given program? #include <iostream> using namespace std; int main () { int items[3][5] = { {-1, 1, 3, 4, 45}, {4, 3, 99, 0, 7}, {3, 2, 66, 94,8}} ; cout << items[1][2]; return 0; } 99
Which of the following declares a two-dimensional array? int array [10]; int array; int array[2][3]; array(2)(3); int array[2][3];
What is the index number of the last element of an array with 29 elements? 28
What is the output of the program? #include <iostream> using namespace std; int main() { int myArray[] = {1,2,3,4,5}; for (int i = 0; i<5; i++) { cout << myArray[i] << " "; i++; } } 1 3 5
What is the output of the given code? #include <iostream> using namespace std; int main() { int a[3] = {10,12,14}; int i=0; while(i<3) { cout << a[i] << " "; i++; } } 10 12 14
What is the output of the program? #include <iostream> using namespace std; int main() { int myArray[] = {1,2,3,4,5,6}; for (int i = 0; i<6; i++) { i++; cout << myArray[i] << " "; } } 2 4 6
What is the output of the program? #include <iostream> using namespace std; int main() { int myArray[] = {2,4,6,8,10,12}; for (int i = 0; i<6; i++) { cout << myArray[i] << " "; } } 2 4 6 8 10 12
In a given array int x[3][4] = {{0,1,2,3}, {4,5,6,7}, {8,9,10,11}}; what is index of 5? x[1][1]
In order to have an array with 5 rows and 10 columns, the correct declaration should be: int x[5][10];
Check the array below: int array[3][5] { { 1, 2, 3, 4, 5 }, { 6, 7, 8, 9, 10 }, { 11, 12, 13, 14, 15 } }; What’s the index of the array where it contains the value 10? array[1][4]
What is the output of the program? #include <iostream> using namespace std; int main () { int a[5][2] = { {0,0}, {1,2}, {2,4}, {3,6}, {4,8}}; int sum = a[2][0]+a[1][1]; cout << sum << endl; return 0; } 4
#include <iostream> using namespace std; int main () { int items[3][5] = { {0, 1, 3, 4, 45}, {4, 3, 99, 0, 7}, {3, 2, 66, 94,8}} ; cout << items[1][2]; return 0; } What would be the command if you will replace 99 with 13? items[1][2] = 13;
Created by: Heirm
 

 



Voices

Use these flashcards to help memorize information. Look at the large card and try to recall what is on the other side. Then click the card to flip it. If you knew the answer, click the green Know box. Otherwise, click the red Don't know box.

When you've placed seven or more cards in the Don't know box, click "retry" to try those cards again.

If you've accidentally put the card in the wrong box, just click on the card to take it out of the box.

You can also use your keyboard to move the cards as follows:

If you are logged in to your account, this website will remember which cards you know and don't know so that they are in the same box the next time you log in.

When you need a break, try one of the other activities listed below the flashcards like Matching, Snowman, or Hungry Bug. Although it may feel like you're playing a game, your brain is still making more connections with the information to help you out.

To see how well you know the information, try the Quiz or Test activity.

Pass complete!
"Know" box contains:
Time elapsed:
Retries:
restart all cards