Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David Kroenke, David J. Auer

3rd Edition

0131986252, 978-0131986251

More Books

Students also viewed these Databases questions

Question

A 300N F 30% d 2 m Answered: 1 week ago

Answered: 1 week ago

Question

Describe the nature of negative messages.

Answered: 1 week ago