Home Answers Viewqa Java-Beginners How to write Java Program

 
 


srinibash
How to write Java Program
1 Answer(s)      2 years and 5 months ago
Posted in : Java Beginners

how to write a program to find average of 5 student marks .

View Answers

December 15, 2010 at 4:27 PM


Hi Friend,

Try the following code:

import java.util.*;
class  AverageOfFiveStudentsMarks
{
    public static void main(String[] args) 
    {
        double sum=0;
        Scanner input=new Scanner(System.in);
        double marks[]=new double[5];
        for(int i=0;i<marks.length;i++){
        int j=i+1;
        System.out.print("Enter marks of Student "+j+": ");
        marks[i]=input.nextDouble();
        sum+=marks[i];
        }
        int len=marks.length;
        double average=sum/len;
        System.out.println("Average of  student's marks is: "+average);
    }
}

Thanks









Related Pages:
How to write Java Program
How to write Java Program  how to write a program to find average of 5 student marks
how to write this program
how to write this program  Write a program in java which calculates... or numerical grade. You will be submitting TWO versions of this program. Write one...?˘s GPA. This program should take a studentââ?¬â?˘s First Name, Last Name a GPA
how to write this program? - Java Beginners
how to write this program?  (game:scissor,rock ,paper) A program that plays the sciccor-rock-paper game.Revise the program to let the user continuously play until either the user or the computer wins more than 4 times
Write a java application program........?
Write a java application program........?  Welcome every One : I have Q in Java? Q : Write a java application program that reads 20 integer numbers input by the user and prints how many numbers > 100 and how many numbers
how to write the program - Java Beginners
how to write the program  WAP to create the report card user input Name, Class, Division, Roll no., Marks obtained in following subjects Lang Hindi History Geography Math Phy Chem. Bio Eve CSTA Also has a back up
WRITE A PROGRAM IN JAVA
WRITE A PROGRAM IN JAVA  How do I write a program in Java, have the program display a message with your name in it and a number (Hello john Smith!1) The number must increment from zero to nine, or decrement fron nine to zero. You
How to write in File in Java
How to write in File in Java  Hi, How to write in File in Java. Please suggest and give example of this program. thanks
how do i write a java program for this??
how do i write a java program for this??  â??Ask the user if they have a dog. If â??yesâ??, ask the user how old is and compute the dogâ??s age... in your program
write following program
-threading. Explain with examples Q2 Write a java applet that takes your name... the state transition diagram of a thread Q6 Write a java applet that displays 9... is a java applet? Write a java applet to display "Hello JAVA". Also write the relation
How to write in File in Java
How to write in File in Java  Hi, How to write in File in Java... bufferedWriter object to write in the file. For more details and examples related to How to write in File of Java Program
write a program
write a program  write a program add 2 no.s without use arithmetic,unary operaters in java
how to write a program to search a record using mvc2
how to write a program to search a record using mvc2   how can we write a code to search a record in table by using java bean as model, servlet as contoller and jsp as view
How to Write to file in Java?
How to Write to file in Java?  How to Write to file in Java Program... the Examples of How to write to File in Java Program: WriteToFileExample.java import... how to write in a file."); br.close(); } catch (Exception e) { System.err.println
write a java program
write a java program  write a program to print '*' in a circular form
How to write program to show status of seats(i.e.free or reserve) in java?
How to write program to show status of seats(i.e.free or reserve) in java?  I have retrieved data from database table and I want to display status of seats i.e.free or reserved
How to write to xml file in Java?
How to write to xml file in Java?  Hi Friends, Can anyone help me how to write in xml file in Java programming. Please fill free to give example... in java program we need to use the package javax.xml. This javax.xml package
How to write calculator in J2ME program?
How to write calculator in J2ME program?  How to write calculator in J2ME program
how to write servlet program in eclipse?
how to write servlet program in eclipse?  how to write servlet program in eclipse
how to write append file in Java
how to write append file in Java  How to write append file in Java... existing file should be retained when you are trying to write new contents in an existing files. For this in java program we uses WriteToFileAppend.java to be used
how to write to java program to get the particular data from the website
how to write to java program to get the particular data from the website   i have to get the particular data by selecting the just numbers.. from the site .. how to get the ful details from the website by clicking the number
WRITE A PROGRAM IN JAVA
WRITE A PROGRAM IN JAVA  Write program which accepts five students id,name,age,department,courses, taken and its grade. a. calculate its GPA . display all student information in ascending order
how to write a program in java to print numbers in equalateral triangle
how to write a program in java to print numbers in equalateral triangle  the output must be 1 324 76589   Here is an example of pattern 1 2 3 4 5 6 7 8 9 Example: public class NumberTriangle{ public
Write a program in java...
Write a program in java...  Hi, friends Please, can you help me? Q1: Write a program in java to simulate a calculator. Your program should take two... to enter an integer number. Write a program in java to find the factorial
Please write code for this program in java and Explain it ? pl'sssssssss
Please write code for this program in java and Explain it ? pl'sssssssss ... that were ever alive at one time. Write a method to compute this, given the above array of 2n integers. Write one of the following methods: C/C++: int
write a program - Java Beginners
write a program  1. write a program that reads a string composed of 6 words then generate and print a word composed of the first letters of the 6 words.  Hi friend, Code to solve the problem : class FirstLetter
write program - Java Beginners
write program  write a java program that will read the values...]); } System.out.println(); } } } For more information on java visit to : http://www.roseindia.net/java/beginners/ Thanks
write a program in java.
write a program in java.  arrange the natural n umber in 5x5 matrix as 21 22 23 24 25 20 7 8 9 10 19 6 1 2 11 18 5 4 3 12 17 16 15 14 13 i at centerd position and remaining arrange in anticlockwise direction.  
How to write to file using FileOutputStream
How to write to file using FileOutputStream  Hi friends, Please help me in java program. How to write to file using FileOutputStream? thanks,   Hi, To write a file using FileOutputStream, we have to use
how to write to file at the end of the line
how to write to file at the end of the line  Hi, Where do i learn how to write to file at the end of the line using Java program. Plz suggest... will help you for "How to write the file at the end of line using Java language
how to write a english dictionary project in java
how to write a english dictionary project in java  please give me idea how to write program/source code for dictionary project
write a program in java to demonstrate the complete life cycle of servlet:
write a program in java to demonstrate the complete life cycle of servlet:  l have an assignment question. i don't know how to write the code for this program. my question is :Write a program in Java to demonstrate the complete
How to Program in Java
This tutorial tells you how to program in Java? As a beginner you must know... to write Java program. Here are the steps of programming Java: Step 1: Download... program) for more details on "How to Program in Java?". Create simple
How to write to file using FileWriter
How to write to file using FileWriter  hi, How to write to file using FileWriter thanks,   Hi, To writing in a file in Java program we...) etc. This link will helpful for you http://www.roseindia.net/java/examples/io
Java Write To File - Java Tutorial
of Java Tutorial you will learn how to write java program to write to a file. We... Java Write To File - Java Tutorial Learn how to write to a file from Java program. This tutorial teaches you how you can use the OutputStreamWriter
How to write file from inputstream in java
link to your query "How to Write to inputStream in Java". This is good...How to write file from inputstream in java  Hi, how to write file from inputstream in java program. Plz suggest an example or suggested link
how to write tis java programming - Java Beginners
; displays the details of facility how to write tis program in java.....pls reply...how to write tis java programming   Airport Transport Service.... Using Transport.class and Facility.class, write a program that displays
Java Write to File
Java Write to File In this tutorial you will learn how to write to file in java. Write to a file in java we are required to use some classes of java.io... doing the basic process to execute a java program write simply on command
really need help on how to write this program plz some 1 help out. - Java Beginners
really need help on how to write this program plz some 1 help out.  i... understand how to code it so can some 1 help out. Part II Write, compile and execute a Java program that displays the following prompts: Enter
Java Write To File - Java Tutorial
of OutputStreamWriter class that is used to write text (as opposed to binary data... an internal FileOutputStream to write bytes to the specified file BufferedWriter : The BufferedWriter class is used to write text
How can I write a GUI stack program by Java to push Image files instead of other data type items?
How can I write a GUI stack program by Java to push Image files instead of other data type items?   How can I write a GUI stack program by Java to push Image files instead of other data type items? for the push instruction I
Read and write file
Read and write file  HI, How to read and write file from Java program? Thanks   Hi, See the following tutorials: Java Write To File Read File Thanks
Java Write To File By Line
Java Write To File By Line In this tutorial you will learn how to write... this example : After doing the basic process to execute a java program write... that you are trying to write in that file by java program like as : Download
java program
java program  how to write an addition program in java without using arithematic operator
How to Write to a File in Java without overwriting
Learn how to Write to a File in Java without overwriting in your Java program This tutorial teaches you how to write to a file in Java without overwriting... In the above program you have learned how to write code to to append the content
Java program
Java program  How to write for drawing a face in java
Java program
Java program  How to write code in order to draw a face in java
Java program
Java program  How to write code in order to draw a face in java
how to write to file primitive type double
how to write to file primitive type double  Hi, How to write to file primitive type double in java program? thanks   Hi, To write... a writeDouble() method to write a double value in binary files. writeDouble
Java Write To File CSV
Java Write To File CSV In this tutorial you will learn how to write to file... this example : After doing the basic process to execute a java program write... with containing the text that you are trying to write in that file by java program like
How to write a program count total prices
How to write a program count total prices  Hi. all I've got a assignment to write a program that count total prices of 8 costumers. class PriceCalculator{ public void method(double quantity) { double result

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.