COMP 3080 - As it pertains to array, which of the following statements

Question # 00679219 Posted By: dr.tony Updated on: 05/01/2018 08:38 AM Due on: 05/01/2018
Subject Computer Science Topic General Computer Science Tutorials:
Question
Dot Image

1.As it pertains to array, which of the following statements are invalid?

select one or more

a>int arr=[5,10,15,20,25];

b>int arr[]=5,10,15,20,25;

c>int[] arr=[5,10,15,20,25];

d>int arr[]=[5,10,15,20,25];

e>int[5]arr=[5,10,15,20,25];


2.What happens when you attempts to compile and run the following program codes?

int i=10;

while(i >= 0)

{

System.out.println(i);

i++;


}

a> The program compiles run , but it gets stuck in infinite loop

b>the program does not compile

c>the program compiles but does nothing

d>the program compiles and run successfully


3.Given the following integer values: 50 45 20 25 30 70 5 80

Using the selection sort method , to sort the values in ascending order, the state of the list after three passes is: select one


a> 5 45 20 25 30 70 50 80

b> 5 20 25 45 30 70 50 80

c> 5 20 45 25 30 70 50 80

d> 5 20 25 30 45 70 50 80


4.Consider the following two lines of code:

int [] x = [2,3,4,5,6,7,8,9,1,0]

int y= x[1] + x[x[0]];


What value is stored in the variable y?

a 5

b 6

c Cannot be determined

d 1

e 4

f 7


5.Which of the following statements concerning arrays are true? Select all valid answers

a an array is an object

b the elements of an array can either be objects or primitive data values

c all the elements in an array have the same type

d the array sized is fixed after it is created


6.Which of the following are valid declarations for linear arrays?

a int vehicle [25];

b int vehicle;

c int [] vehicle;

d int [25] vehicle;

e int vehicle[];


6.Sorting is the act of arranging items in some specified order- such as alphabetical order, or rank such as grouping items that more popular than others.

TRUE

FALSE

Dot Image
Tutorials for this Question
  1. Tutorial # 00678460 Posted By: dr.tony Posted on: 05/01/2018 08:39 AM
    Puchased By: 3
    Tutorial Preview
    The solution of COMP 3080 - As it pertains to array, which of the following statements...
    Attachments
    a,,,,,,,,,,.docx (13.13 KB)
    Recent Feedback
    Rated By Feedback Comments Rated On
    pe...n89 Rating The homework was precisely done 08/29/2018

Great! We have found the solution of this question!

Whatsapp Lisa