05 Jun COMP 3080 – As it pertains to array, which of the following statements
Question
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
Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Ask A Question and we will direct you to our Order Page at WriteDemy. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.
Fill in all the assignment paper details that are required in the order form with the standard information being the page count, deadline, academic level and type of paper. It is advisable to have this information at hand so that you can quickly fill in the necessary information needed in the form for the essay writer to be immediately assigned to your writing project. Make payment for the custom essay order to enable us to assign a suitable writer to your order. Payments are made through Paypal on a secured billing page. Finally, sit back and relax.
About Writedemy
We are a professional paper writing website. If you have searched a question and bumped into our website just know you are in the right place to get help in your coursework. We offer HIGH QUALITY & PLAGIARISM FREE Papers.
How It Works
To make an Order you only need to click on “Order Now” and we will direct you to our Order Page. Fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.
Are there Discounts?
All new clients are eligible for 20% off in their first Order. Our payment method is safe and secure.
