SJSU/Udacity CS046

Problem Set 7

  1. Arrays 1
  2. Arrays 2
  3. Arrays 3
  4. Array Algorithms
  5. Reverse Array
  6. Count Matches
  7. Fill Array
  8. Array Methods
  9. Temperature 1
  10. Temperature 2

Arrays 2

int[] primes = _______________ ;
int length = ________________ ;
Write the statement to assign 95 to the initial element of an int array scores scores[0] = 95;
Complete this code to initialize an integer array containing the prime numbers less than 10 (They are 2, 3, 5, 7, 9) at the time it is declared { 2, 3, 5, 7, 9 }
Given this statement
double temperatures = new double[12];
the indexes can range from ____ to ____
0 11
You have an int array variable scores of unknown length. Complete this code to find the length of the array. You can assume the scores variable is not null. scores.length
You have an int array variable scores of unknown length. Write the code to assign 98 to the last element of the array. You can assume the scores is not null. scores[scores.length - 1] = 98;

Problem on this page?

Your name:

Your email address:

Problem description:

To protect against spam robots, please answer this simple math problem:
× =