Program 1 : Write a program which does the following: Take 10 inputs in a loop from the user and store it in a double data type array. Using a ‘for-each’ loop, calculate and print the total sum of even numbers in the array. And print the average of all numbers in the array. Write Javadoc comments for the class mentioning your name as author and a brief
Write a program which does the following:
-
Take 10 inputs in a loop from the user and store it in a double data type array.
-
Using a ‘for-each’ loop, calculate and print the total sum of even numbers in the array.
-
And print the average of all numbers in the array.
-
Write Javadoc comments for the class mentioning your name as author and a brief
description of the class.
-
Submit the program and screenshots of the output and Javadoc HTML page.
Program 2 :
Write this program using “for-each” loop to get the same output as the “for” loop in below program:
(See attached image)
Program 3:
Given the below 2 arrays:
int arr1[] = { 9,8,7,6,5,4,3,2,1,0 };
int arr2[] = { 99, 89, 79, 69, 59 };
Write a program to replace 79 in arr2 with 4 from arr1. Print the final arr2 using Arrays.toString() method.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images