Question

Question 31 -Given the following code fragment, what value is contained in myArr[O]? const int ARRAYSIZE 3 double() myArr new double [ARRAYSIZE] myArr [0]1.1 myArr [1]2.2; myArr [2] myArr [0] myArr[1 O3.3 2.2 O 1.1 0
Question 32 - Given the following code fragment, what is displayed in IblResult? const int ARRAYSIZE 3 double(] myArr - new double [ARRAYSIZE] myArr [0] - 1.1 myArr [1] 2.2 lblResult.Text - Convert.Tostring (myArr (01) 3.3 O 2.2 1.1 0
Question 33 - Given the following code fragment, what is displayed in IblResult? const int ARRAYSIZE3 int[l myArr new int [ARRAYSIZE] myArr [0]1.1; myArr [1] = 2.2; myArr [2] myArr[0] + myArr [1]; lblRe sult. Text = Convert. ToString (myArr[1]); 3.3 2.2 O 1.1 0
Question 34 A(n) is a group of variables that have the same name and data type, and are related in some way O subscript string array run time error Question 35 1 p An array is defined as follows: intl] numbers- new int[4] How many elements does the array have? One Two O Three Four
Question 36 Assigning initial values to an array is often referred to as sorting the array populating the array O assigning the array declaring the array Question 37 Which of the following correctly declares an array of integers? Assume SIZE is a valid constant. numbersArray new int[SIZE] Oint[l numbersArray new int[SIZE]: O wholeNum[] numbersArray int[SIZE] int[] numbersArray new Array;
Question 38 -Given the following code fragment, what is the content of the last array element? const int ARRAYSIZE 3; double(] myArr new double [ARRAYSIZE] myArr [0]1.1; myArr [1]2.2; myArr [2] 3.3; O 1.1 2.2 3.3 all of the above
Question 39 - Given the following code fragment, what is the content of the first array element? const int ARRAYSIZE 3; double[] myArrnew double [ARRAYSIZE] myArr[0] = 1.1; myArr [1]2.2; myArr (2] 3.3; ○ 1.1 O 2.2 3.3 none of the above
Question 40 Given the following code fragment, what is displayed in IblResult? const int ARRAYSIZE-3 doublel] myArr - new double ARRAYSIZE]; myArr[O] 1.1; myArr[1] 2.2; myArr[2] myArr(O] + myArr[1] lblResult.Text - Convert.ToString(myArr[2]); 3.3 O 2.2 1.1 0
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Hi, please find the answer below:

31. Answer: 1.1

As myArr[0] is assigned 1.1. It will contain 1.1

32. Answer: 1.1

String form of 1.1 is '1.1'

33. Answer 2.2

String form of 2.2 is '2.2'

34. Answer: Array

An array is a group of variables that have the same name and data type and are related in some way.

35. Answer: Four

The array is initialized with four zeros: number = [0,0,0,0]

36. Answer: Declaring the array

When you declare the array, it will initialize all values to 0's.

37. Answer: int[] numbersArray = new int[SIZE];

Valid declaration is of form : datatype [] name = new datatype[size]

38. Answer: 3.3

As myArr[2]=myArray[0]+myArr[1].

39. Answer: 1.1

Because myArr[0]=1.1 is declared.

40. Answer: 3.3

String form of 3.3 is '3.3'

I hope, the explanation is clear and is useful in your understanding.

Add a comment
Know the answer?
Add Answer to:
Question 31 -Given the following code fragment, what value is contained in myArr[O]? const int ARRAYSIZE...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Consider the following C++code snippet and what is the output of this program? # include<iostream> using...

    Consider the following C++code snippet and what is the output of this program? # include<iostream> using namespace std; void arraySome (int[), int, int); int main () const int arraysize = 10; int a[arraysize]-1,2,3,4,5, 6,7,8,9,10 cout << "The values in the array are:" << endl; arraySome (a, 0, arraySize) cout<< endl; system ("pause") return 0; void arraySome (int b[], int current, int size) if (current< size) arraySome (b, current+1, size); cout << b[current] <<""; a) Print the array values b) Double...

  • What is wrong with the following function definition? void fill(const int a[], int size) { for...

    What is wrong with the following function definition? void fill(const int a[], int size) { for (int i = 0; i < size; i++) {     a[i] = 0; } return; } Answers: The function cannot change the array parameter. The array should be passed as a call-by-reference, not call-by-value. The for loop causes an out-of-bounds indexing error. Nothing, the code works fine as is.

  • 8. Given the following code fragment and function definition, what is(are) the output(s)? int funct (int...

    8. Given the following code fragment and function definition, what is(are) the output(s)? int funct (int n) int var = 1; while(n > 0) cout << funct(7)<<" "<<funct(0); var *= n; n--; return var;

  • Write the following function: const int MIN_SIZE = 2; const int MAX_SIZE = 8; const int...

    Write the following function: const int MIN_SIZE = 2; const int MAX_SIZE = 8; const int UNKNOWN = 0; const int RED = 1; const int BLUE = 2; const char UNKNOWN_LETTER = '-'; const char RED_LETTER = 'X'; const char BLUE_LETTER = 'O'; const string UNKNOWN_STRING = "unknown"; const string RED_STRING = "X"; const string BLUE_STRING = "O"; /** * Requires: size <= MAX_SIZE and size is a positive even integer, *           0 <= row && row < size....

  • QUESTION: ADT stack: resizable array-based implementation    for Ch4 programming problem 4 "maintain the stacks's top...

    QUESTION: ADT stack: resizable array-based implementation    for Ch4 programming problem 4 "maintain the stacks's top entry at the end of the array" at array index N-1 where the array is currently allocated to hold up to N entries. MAKE SURE YOU IMPLEMENT the functions:  bool isEmpty() const; bool push(const ItemType& newEntry); bool pop(); in ArrayStackP4.cpp //FILE StackInterface.h #ifndef STACK_INTERFACE_ #define STACK_INTERFACE_ template<class ItemType> class StackInterface { public:    /** Sees whether this stack is empty.    @return True if the...

  • What does the following code fragment print? Explain the result? int [] a = new int[10];...

    What does the following code fragment print? Explain the result? int [] a = new int[10]; for (int i = 0; i < 10; i++)    a[i] = 9 - i; for (int i = 0; i < 10; i++)    a[i] = a[a[i]]; for (int i = 0; i < 10; i++)    System.out.println(a[i]);

  • Question 1) Suppose a program has the following code: const int X = 2, Y =...

    Question 1) Suppose a program has the following code: const int X = 2, Y = 3; int sum; int values[X][Y] = {{1, 2, 3},                                  {4, 5, 6}}; for(int i=0; i<X; i++) {      sum=0;      for(int j=0; j<Y; j++)         sum+=values[i][j];    cout<<sum<<endl; } What is this program getting the sum of? Group of answer choices D-) The columns of the 2D array C-) The rows of the 2D array A-) All of the elements of the 2D...

  • Given the following code segment, int x = 20; int y = 7; what is the...

    Given the following code segment, int x = 20; int y = 7; what is the data type of the value of the expression (x % y) ? (3 points) Question 1 options: 1) int 2) double 3) numeric 4) Error: possible loss of precision 5) Unable to be determined Question 2 (3 points) Given the following code segment, double x = 42.3; double y = 11.7; what is the data type of the value of the expression (x %...

  • Q-1: Given the following code fragment, what is its Big-O running time? test = 0 for...

    Q-1: Given the following code fragment, what is its Big-O running time? test = 0 for i in range(n):             for j in range(n):                         test= test + i *j Q-2: Given3 the following code fragment what is its Big-O running time? for i in range(n):             test=test+1 for j in range(n):             test= test - 2 Q-3: Given the following code fragment what is its Big-O running time? i = n while i > 0:             k=2+2             i...

  • Question 24 Given the following code fragment and the input value of 2.0 for total, what...

    Question 24 Given the following code fragment and the input value of 2.0 for total, what output is generated? double tax; double total: cout << "enter the costof the item\n"; cin >>total: if total >-3.0) tax 0.2: K< endi: cout << total +(total tax) eise tax 0.1 tax) aout ce total +Ktotal

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT