Question
1. Declare and instantiate an array named scores of twenty-five elements of type int. 2. Write a statement that declares an array named streetAddress that
1. Declare and instantiate an array named scores of twenty-five elements of type int.
2. Write a statement that declares an array named streetAddress that contains exactly eighty elements of type char.
3. Suppose v is an array with 100 int elements. If 100 is assigned to v[100], what happens? Explain why do you choose your answer?
(A). The compiler issues an error message.
(B). The compiler issues a warning message.
(C). An exception will be thrown when that statement is executed.
(D). Another variable or array will be unexpectedly modified.
4. An array of 1000 integers has been created. What is the largest integer that can be used as an index to the array? why?
(A). 1001
(B). 1000
(C). 999
5. Consider the declaration: int v[] = new int[1]; What is the index of the last element of this array? why?
(A). 0
(B). 1
(C). 2
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started