Question: (JAVA) 1)What is printed from the following statements: int x[] = int [10]; for(int i=50; i <500; i +=50) x[i] = i; 2)Create an array

(JAVA)

1)What is printed from the following statements:

int x[] = int [10];

for(int i=50; i<500; i +=50)

x[i] = i;

2)Create an array of 100 integers. Store random integers in the range 60-200 in the array elements. Write all the required statements, not the whole program.

3)Create a 2-dimensional array of strings with 2 rows and 3 columns. Assume each row has a persons name, his/her city name, and its zip code. Write assignment statements to assign Washington, Mt. Vernon, 22309 to the second row elements of the array you created.

4)Write the method printArray() which accepts an array of decimal numbers and prints them in the method.

5)Write the method sumArray() which accepts an array of integers and returns the sum of all the numbers.

6)Write a method to accept a 2-D array of decimals and print the array in a matrix form.

7)Write statements to define an Animal class and its constructors. Each animal will have a species (like elephant) and classification (like mamal, fish, birds, reptiles, amphibians, and invertibrates).

8)Write statements to define an Elephant as a sub-class of Animal class and its constructors. Each elephant will have subspecies (Asian or African) and population (like 28000 Indian elephants).(Java)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!