Latest Tutorials| Questions and Answers|Ask Questions?|Site Map




Have Programming Question? Ask it here!
 
 
 


shrikant
java program
1 Answer(s)      3 years and a month ago
Posted in : Java Beginners


write a java program to display array list and calculate the average of given array.


Advertisement
View Answers

August 11, 2011 at 10:48 AM


class  ArrayExample{
    public static void main(String[] args)throws Exception{
        int sum=0;
        int array[]={1,2,5,6,7,3,5,2,3,4};
        for(int i=0;i<array.length;i++){
            sum+=array[i];
        }
        System.out.println("Array Elements are: ");
        for(int i=0;i<array.length;i++){
        System.out.println(array[i]);
        }
        System.out.println("Sum Of Array Elements is: "+sum);
        System.out.println("Average of Array Elements is: "+(double)sum/array.length);
        }
}


Related Tutorials/Questions & Answers:
java program for
java program for   java program for printing documents,images and cards
Java Program
Java Program  A Java Program that print the data on the printer but buttons not to be printed
Advertisements
java program
java program  write a program to print 1234 567 89 10
java program
java program  how to write an addition program in java without using arithematic operator
java program
java program  write java program for constructor,overriding,overriding,exception handling
java program
java program  write a java program to display array list and calculate the average of given array
java program
java program  write a java program to display array list and calculate the average of given array
java program
java program  write a java program to compute area of a circle.square,rectangle.triangle,volume of a sphere ,cylinder and perimeter of cube using method over riding
java program
java program  write a java program to compute area of a circle.square,rectangle.triangle,volume of a sphere ,cylinder and perimeter of cube using method over riding
java program
java program   Write a program to find the difference between sum of the squares and the square of the sums of n numbers
java program
java program  write a program to create text area and display the various mouse handling events
java program
java program  Develop the program calculatePipeArea. It computes the surface area of a pipe, which is an open cylinder. The program accpets three values: the pipes inner radius, its length, and the thickness of its wall
java program
java program  . Develop the program calculatePipeArea. It computes the surface area of a pipe, which is an open cylinder. The program accpets three values: the pipes inner radius, its length, and the thickness of its wall
java program
java program  . Write a program which performs to raise a number to a power and returns the value. Provide a behavior to the program so as to accept any type of numeric values and returns the results
Java program
Java program  Write a program which performs to raise a number to a power and returns the value. Provide a behavior to the program so as to accept any type of numeric values and returns the results
program in java
program in java  write a reverse program in java using string buffer.the input and out put as follows. input- hi good mornig out put-ih doog ginrom
java program
java program  write a program to create server and client such that server receives data from client using BuuferedReader and sends reply to client using PrintStream
java program
java program  write a java program to read a file which hold email address validate email address tohave formate @.* and replace all .com email address
java program
java program  write a java program to create an array of size 10 by taking input from bufferreader and find out the average of array elements from that array
java program
java program  write a java program to create an array of size 10 by taking input from bufferreader and find out the average of array elements from that array
java program
java program  write a java program to create an array of size 10 by taking input from bufferreader and find out the average of array elements from that array
java program
java program  Write a program that computes loan payments. The loan can be a car loan, a student loan, or a home mortgage loan. The program lets the user enter the interest rate, number of years, loan amount, and displays
java program
java program  write a program that accepts only 3 integer values as command line arguments.print the values enter by the user. handle ArrayIndexOutofbounds exception and number format exception by providing appropriate message
java program
java program  write a program showing two threads working simultanously upon two objects(in theater one object "cut the ticket" andsecond object "show is the seat
java program
java program  . Develop a program that computes the distance a boat travels across a river, given the width of the river, the boat's speed perpendicular to the river, and the river's speed. Speed is distance/time
A java Program
A java Program  Write a java program, which provides a text area with horizontal and vertical scrollbar.Type some lines in the text area and use scrollbars to move the text within the text area.Read a word in a text field
java program
java program  write a java program to read a file content into a string object using available and read methods of java bufferedinputstream.   Please visit the following link: http://www.roseindia.net/java/example/java
java program
java program  write a java program which shows how to declare and use STATIC member variable inside a java class.   The static variable are the class variables that can be used without any reference of class. class
java program
java program  Develop the program calculateHeight, which computes the height that a rocket reaches in a given amount of time. If the rocket accelerates at a constant rate g, it reaches a speed of g ? t in t time units
java program
java program  Develop the program calculateHeight, which computes the height that a rocket reaches in a given amount of time. If the rocket accelerates at a constant rate g, it reaches a speed of g ? t in t time units
Java Program
Java Program  Write a Java program so that when the program is executed, a window will appear with white background. The window should be of size 400x400 pixels. Then when the user clicks at the window, a circle of size 20
Java Program
Java Program  Write a Java program so that when the program is executed, a window will appear with white background. The window should be of size 400x400 pixels. Then when the user clicks at the window, a circle of size 20
Java program
Java program  Write a Java program that demonstaress multiple inheritance.   Java does not support Multiple Inheritance but you can show... the following link: http://www.roseindia.net/java/language/inheritance.shtml
java program
java program  write a java script program that would input the ff:Student Name,Average,Tuition Fee and output Total Tuition Fee. Formula: Total Tuition Fee=Tuition Fee-Discount If average is: 95-100 100% discount 90-94 25% 85-89
java program
java program  write a java script program that would input the ff... and below no discount   write a java script program that would...% 84 and below no discount   write a java script program
Java program
Java program  Write a Java program that takes 3 integer numbers from command line and display maximum number. (Use conditional operator)   Java display maximum number using conditional operator: import java.util.
JAva program
JAva program  Write a JAva program that takes various string from command line and display them in sorted order.   Java display strings in sorted order: import java.util.*; class ArraySort{ public static void main
Java program
Java program  Write a Java program that tales filename or directo;ry name from command line. If it is a vlid flename then it should display its... of files in that directory.   Java Check File import java.io.*; import
java program
java program  write a java program to add or substract days in current date and time value using JAVA calender class.   Add Days import java.util.*; public class AddDaysToDate { public static void main(String
program in java
program in java  a program to develop a client, server application to satisfy the requests from multiple clients
program in java
program in java  a program to develop a client, server application to satisfy the requests from multiple clients
java program
java program  Problem 1 Write a javaScript program that would input Employee Name, rate per hour, No. of hours worked and will compute the daily wage of an employee. If the number of hours worked exceeds eight hours 30% to each
java program
java program  Problem 2 Note:Use prompt command to input values and use document.write command to display the output. Write a JavaScript program that would input a student's final grade from 50-100. Evaluate the Final Grade
java program
java program  Problem 2 Note:Use prompt command to input values and use document.write command to display the output. Write a JavaScript program that would input a student's final grade from 50-100. Evaluate the Final Grade
Java Program
Java Program  A Simple program of JSP to Display message, with steps to execute that program   Hi Friend, Follow these steps: 1)Go...:'hello.jsp' <%@page language="java"%> <%String st="Hello World"; %>
Java Program
Java Program  How to Write a Java program which read in a number... out in the standard output. The program should be started like this: java... to be read. In this example, the program should create three threads for reading
java program
java program  write a program showing two threads working simultaneously upon two objects(in theater one object "cut the ticket" and second object "show the tikect")   import java.io.*; class Theater{ public static
java program
java program  Write a Java program to accept an array list of Employee objects and search for perticular Employee based on Id Number (like ID,Name&Address)   import java.util.Scanner; import java.util.ArrayList
java program
java program  write a java program to get current date and time in the following format: current year is:2007 current month is:12 current date is:23 current hour in 12 hour format is:6 current hour in 24 hour format is:18 current
java program
java program  wap to show concept of class in java
 

 

 

DMCA.com