Last active
December 28, 2021 06:44
-
-
Save rapisenpai/4bd035eef5df18ff53f11734b0f08fc6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package homwad.rafhaellowix.dnsc.edu.ph; | |
import java.util.Scanner; | |
public class ArrayExercise1 { | |
public static void main(String[] args) { | |
double sum = 0; | |
Scanner sc = new Scanner(System.in); | |
int grades[] = new int[20]; | |
int max = grades[0]; | |
int min = grades[0]; | |
System.out.print("Enter final grade for student no. 1: "); | |
int student1 = Integer.parseInt(sc.nextLine()); | |
grades[0] = student1; | |
int passing = 0; | |
for (int i = 0; i < grades.length; i++) { | |
if (grades[i] > max) { | |
max = grades[i]; | |
} | |
if(grades[i] <min) | |
min = grades[i]; | |
System.out.println(grades[i]); | |
if (grades[i] <= 76 || grades[i] <= 80) { | |
passing++; | |
} | |
} | |
System.out.print("\nHighest Grade: " + max); | |
System.out.print("\nLowest Grade: " + min); | |
System.out.println("\nGrade 76-80: " + passing + " Student/s" ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment