logo

Program for Calculating Average of 1000 Grades

   

Added on  2022-08-15

3 Pages306 Words22 Views
Question 39: Program for calculating average of 1000 grades
import java.util.Scanner;
class Calc
{
public static void main (String args[])
{
int i;
double total=0;
double avg;
System.out.println ("How many numbers you want to enter :");
Scanner sc = new Scanner (System.in);
int n= sc.nextInt ();
double [] marks=new double[n];
for (i=0; i<marks.length; i++) {
System.out.println ("Enter the element number "+ (i+1) +": ");
marks [i] = sc.nextDouble ();
}
sc.close ();
for (i=0; i<marks.length; i++) {

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Assignment on Program for Grade
|3
|357
|17

Introduction to Programming with Java - Solved Assignments
|12
|1129
|91

Java Assignment Help | Online Homework
|13
|1219
|353

Program for Displaying all Prime Numbers
|3
|331
|17

Asking User for numbersof Students
|13
|771
|61

Program for Determining Largest and Smallest Number
|3
|425
|25