Course Solutions Uncategorized (Solved) : 1 20 Points Write Java Program Asks User Input Positive Integer N First Create Array Size Q34272594 . . . .

(Solved) : 1 20 Points Write Java Program Asks User Input Positive Integer N First Create Array Size Q34272594 . . . .

 

1. (20 points)

Write a Java program that asks the user to input a positiveinteger n first, then create an array of size n. Fill n randomintegers between 5 and 555, inclusively, into the created array.Output the sum of all the integers in the array and the average ofall the integers in the array.

2. (10 points)

Find the output of the following Java program and explain youranswer.

public class NO2HW1

{

public static void main(String args[])

           {

                       int min = 100;

                       int a = 10;

                       int b = 20;

                       min_method(a, b, min);

                       System.out.println(min);

           }

           

           

public static void min_method(int n1, int n2, int min)

           {

           if (n1 < n2)

                min = n1;

              else

                min = n2;

             

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

(Solved) : Naming Ionic Compounds Common Polyatomic Ions Fill Name Empirical Formula Ionic Compound C Q33140786 . . . .(Solved) : Naming Ionic Compounds Common Polyatomic Ions Fill Name Empirical Formula Ionic Compound C Q33140786 . . . .

<br/><img src="https://media.cheggcdn.com/media%2F399%2F39952e35-eb5b-4bef-8529-f1db3a4eff56%2Fimage.png" alt="Naming ionic compounds with common polyatomic ions Fill in the name and empirical formula of each ionic compound that could be formed from the ions in this table: