Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: Enzo Soriano
Added: May 17, 2021 7:51 AM
Views: 480
Tags: no tags
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package simplegradecalculator;
  7. import java.util.Scanner;
  8.  
  9. /**
  10.  *
  11.  * @author llour
  12.  */
  13. public class SimpleGradeCalculator {
  14.  
  15.     /**
  16.      * @param args the command line arguments
  17.      */
  18.     public static void main(String[] args) {
  19.         // TODO code application logic here
  20.         Scanner enzo = new Scanner(System.in);
  21. System.out.println("Enter Student Name :");
  22. String name = enzo.nextLine();
  23. System.out.println("Enter Student Number :");
  24. Byte number = enzo.nextByte();
  25. Scanner arch = new Scanner(System.in);
  26. System.out.println("Enter Course Subject :");
  27. String subject = arch.nextLine();
  28. System.out.println("Enter Preliminary Grade :");
  29. Integer num1 = enzo.nextInt();
  30. System.out.println("Enter Midterm Grade :");
  31. Integer num2 = enzo.nextInt();
  32. System.out.println("Enter Final Grade :");
  33. Integer num3 = enzo.nextInt();
  34.  
  35. double total = num1 + num2 + num3;
  36. double per = (total / 300) *100;
  37.  
  38. System.out.println("\n\nStudent Name :" +name);
  39. System.out.println("Student Numer :" +number);
  40. System.out.println("Subject :" +subject);
  41. System.out.println("Prelim :" +num1);
  42. System.out.println("Midterm :" +num2);
  43. System.out.println("Final :" +num3);
  44. System.out.println("General Average :" +per);
  45.  
  46. if(per > 76){
  47. System. out.println("Subject Passed!");
  48. }else if(per < 75){
  49.     System. out.println("Subject Failed!");
  50.    
  51. enzo.close();
  52. }}}
  53.    
  54.    
  55.  
  56.