This essay has been submitted by a student. This is not an example of the work written by professional essay writers.
Uncategorized

BUIS 305/INSS 505 SPRING 2020 Chapter 6 Individual Assignment

Pssst… we can write an original essay just for you.

Any subject. Any type of essay. We’ll even meet a 3-hour deadline.

GET YOUR PRICE

writers online

BUIS 305/INSS 505 SPRING 2020 Chapter 6 Individual Assignment

Due by 11:59PM on Wednesday June 24, 2020

 

Instructions: Complete the assignment based on your textbook reading, review of the Powerpoint slides, materials posted on Blackboard and research of the topic. In order to learn and retain the material, you are expected to respond using critical thinking and problem solving skills. Any instance of cheating, copying or other forms of plagiarism will result in a grade of zero for the assignment.

 

Review Questions, Programming Exercises

  1. What are the 3 ways to use constants with arrays?

 

As subscripts eg data[1]=0;

To define array size eg double[] prices=new double[3];

As array elements eg double[] prices={13.0,12.0,11.0};

 

  1. Describe linear search, binary search. Linear search involves traversing the whole array sequentially to find target value while binary search looks for the index of target value by  comparing it to middle element in a sorted array.

 

  1. Define parallel arrays. These are arrays using multiple arrays to represent data on the same object.

Eg

int[] questions= {1,2};

boolean [] answer={true, false};

 

  1. What happens if a subscript is out of bounds? It generates error since it is outside the array.
  2. The first element in an array has a subscript of
  3. The last element in an array has a subscript of the size of array -1.
  4. At what point should you consider changing from individual variables to an array? When there is a large data set of the same data type. Isit reasonable to use an array when you only have two or three items to track? Yes, Why or why not? Consider the number of sets of those two or three items when making your decision. Arrays are dynamic thus easy manipulation
  5. Every element in an array always has the same data type. Why is this necessary?By definition, a declared array only holds data of the same type else generates an error.

 

  1. In the statement below, what value does the element at data[1]hold? 6

What value does the element at data[4] hold? 95.2

double[] data = {92.5, 98.6, 96.1, 90.0, 95.2};

 

 

  1. Write the Java code statement that creates an array of integers named data of size 5.

int[] data= new int[5];

  1. Write the Java code statementthat declares an array of integers called data with elements 7, -1, 13, 24 and 6. Use only one statement to initialize the array.

 

int[]  data = new int[]{7,-1,13,24,6};

 

  1. Evaluate the following code fragment. What is the name of the array?a What is the size of the array? 7

 

Extra credit: What does the for loop do to the array? Add elements to the array. It also prints each array index and its element.

 

 

int[] a = new int[7];
for (int i = 0; i < 7; i++) {
a[i]= i + 1;

System.out.println(“Element at index ” + i +” is  ” + a[i]);
}

  Remember! This is just a sample.

Save time and get your custom paper from our expert writers

 Get started in just 3 minutes
 Sit back relax and leave the writing to us
 Sources and citations are provided
 100% Plagiarism free
error: Content is protected !!
×
Hi, my name is Jenn 👋

In case you can’t find a sample example, our professional writers are ready to help you with writing your own paper. All you need to do is fill out a short form and submit an order

Check Out the Form
Need Help?
Dont be shy to ask