QuestionQuestion

Assignment 1:
Write an application that allows you to initialize and fill in a one-dimensional array of 12 double numbers. (These numbers should be taken as a user’s input). Create and use the custom method to sort the array values in a descending order. (Do not use any of the prebuilt sorting methods of the Array class—any sort type can be implemented, such as bubble sort). Write a separate method that will take the sorted array as an argument and display all of its elements.

Assignment 2:
Write a Java program which defines unconstrained array of user defined length n (the value of n is to be taken from a proper user’s input). Fill in the array with n random numbers. The application should (1) display all elements of the array, (2) display the sum of all elements, and (3) calculate the average of all elements.
Random numbers need to be generated inside the program making use of the prebuilt Java Random numbers generator available in the Math library class.

Solution PreviewSolution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

import java.util.Scanner;


public class Assignment1 {

    /**
    * @param args the command line arguments
    */
    public static void main(String[] args) {
      
       //initialize and fill in a one-dimensional array of 12 double numbers
       double [] number = new double[12];      
       System.out.println("Enter 12 numbers : ");
       Scanner console = new Scanner(System.in);
       //(These numbers should be taken as a user’s input)
       for (int i = 0; i < number.length; i++) {
            number[i] = console.nextDouble();            
       }...
$23.00 for this solution

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Java Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats