0% found this document useful (0 votes)
14 views4 pages

Week 13 Activity

Uploaded by

juencyzalty
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views4 pages

Week 13 Activity

Uploaded by

juencyzalty
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Dela Cruz, Franc Alvenn T

BSIT 1-A

//Module 13 Activity

/*

* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license

* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Main.java to edit this template

*/

package itpacts;

import java.util.*;

/**

* @author user

*/

public class Module12 {

/**

* @param args the command line arguments

*/

public static void main(String[] args){

Scanner input = new Scanner (System.in);

Integer[] grade = new Integer[5];

//loop to input grade

for(int i = 0;i < grade.length;i++){

System.out.print("Input grade: ");

grade[i] = input.nextInt();
}

//sorts array

Arrays.sort(grade,Collections.reverseOrder());

System.out.println("--------------------------------");

//prints highest and lowest grade

System.out.println("Highest Grade: " + grade[0]);

System.out.println("Lowest Grade: " + grade[4]);

//prints whether a grade is passing or failing

System.out.println("--------------------------------");

for(int grades: grade){

if(grades >= 75){

System.out.println("Passing Grade: " + grades);

}else if(grades < 75){

System.out.println("Failing Grade: " + grades);

You might also like