1 Write a Java program that declares an array alpha of 50 elements of type double. Initialize the array so

1)
Write a Java program that declares an array alpha of 50 elements of
type double. Initialize the array so that the first 25 elements are equal to the
square of the index variable, and the last 25 elements are equal to three times the
index variable. Output the array so that 10 elements per line are printed.
2) Write a java function, smallestIndex, that takes as parameters an int array and its size and returns the index of the first occurrence of the smallest element in the array. Also, write a program to test your function

Share This Post

Email
WhatsApp
Facebook
Twitter
LinkedIn
Pinterest
Reddit

Order a Similar Paper and get 15% Discount on your First Order

Related Questions

Obtain the general solution of the following DEs: i. y′′′ + y′′ − 4y′ + 2y = 0 ii. y(4) + 4y(2) = 0 iii. x(x − 2)y′′ + 2(x − 1)y′ − 2y = 0; use y1 = (1 − x) iv. y′′ − 4y = sin2(x) v. y′′ − 4y′ + 3y = x ; use y1 = e3x vi. y′′ + 5y′ + 6y = e2xcos(x) vii. y′′ + y = sec(x) tan(x)

Obtain the general solution of the following DEs: i. y′′′ + y′′ − 4y′ + 2y = 0 ii. y(4) + 4y(2) = 0 iii. x(x − 2)y′′ + 2(x − 1)y′ − 2y = 0; use y1 = (1 − x) iv. y′′ − 4y = sin2(x) v. y′′