Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

This assignment was locked Feb 25 at 11:59pm 1. Write a program that accepts 10

ID: 3906639 • Letter: T

Question

This assignment was locked Feb 25 at 11:59pm 1. Write a program that accepts 10 numbers into an array and then finds and displays the average of the numbers. 2. Write a program that accepts 10 values into an integer array and then prints the largest and the smallest values existing in the array sum of all odd numbers in the array. Display the array, and both the sums. program should also display the total number of prime numbers present in the array. Define a method Boolean 3. Write a program that accepts 10 numbers into an array and then finds and displays the sum of all even numbers and 4. Write a program that accepts 10 numbers into an array and then finds and displays all prime numbers in the array. The Primelint n) which checks if a number is prime. 5. Write a program that accepts 10 numbers into an array. Take the input of two numbers Original and Replacement. The program then replaces all occurrences of a Original by Replacement in the array. Display the original and the new array.

Explanation / Answer

As per chegg policy. Solving Ques 1. Please post other questions saperatly.

Please do rate this answer positive, If i was able to help you. Let me know if you have any issues in comments

public class JavaPractice {

public static void main(String[] args) {

int arr[] = new int[10];

System.out.println("Please enter 10 numbers : ");

Scanner sc = new Scanner(System.in);

for (int i = 0; i < 10; i++) {

System.out.print("Please enter #" + (i + 1)+": ");

arr[i] = Integer.parseInt(sc.next());

}

int sum = 0;

for (int i = 0; i < 10; i++) {

sum = sum + arr[i];

}

System.out.println("Average of numbers: " + (sum / 10.0));

}

}

Output

Please enter 10 numbers :
Please enter #1: 20
Please enter #2: 34
Please enter #3: 12
Please enter #4: 84
Please enter #5: 22
Please enter #6: 44
Please enter #7: 84
Please enter #8: 23
Please enter #9: 94
Please enter #10: 82
Average of numbers: 49.9

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote