Write a program that uses an array to find the average
Course:- JAVA Programming
Reference No.:- EM131599412

Assignment Help
Assignment Help >> JAVA Programming

1. Show two ways to declare a one-dimensional array of 12 doubles.
{1.0, 2.0, 3.0, 4.0, 5.0, 6.0,7.0, 8.0, 9.0, 10.0, 11.0, 12.0};
For the first example print the 7.0 and 10.0 in a println.
Example - Your println should match
For the first example print the 2.0 and 12.0 in a println.
Example - Your println should match

2.Write a program that uses an array to find the Average of 10 double values.
Use Math.random() in combination with a for loop to fill the array with 10 random values.
Then use a different for loop to iterate through the array when summing the total for all 10 double values.

Put your comment

Ask Question & Get Answers from Experts
Browse some more (JAVA Programming) Materials
Write a java applet (not a java application program) for costco gas station. The applet will first ask you whether you are a costco customer, then the grade of gas you wan
Create your program using Eclipse. Name your project Assignment5 and the Java class Loops. Use the Scanner class to get input from the user and use System.out to print to the
What is the value of returnValue after the following code has been executed?x = "150";y = "100";returnValue= x - y; Which of the following uses correct syntax to receive a val
Discussing how to setup a program to respond to events from any one of these sources - How do you create the necessary listener class? How do you associate the listener object
Read a data file, create the internal data structure, create a GUI to display the structure, and let the user search the structure. Sort the structure, use hash maps to creat
Create a simple Java application that uses the String class and/or the StringBuffer class and at least 4 of the class methods. Show the code, demonstrate it works properly a
Write down IJVM code which will remove these top two words, multiply and put their product back on stack. You are allowed to use existing IJVM instructions only.
Unique index integer fields Use at least 5 other fields of various, including at least one of each of String, int and double types. assume that the String's have no spaces wit