Tuesday, September 7, 2021

Average Grade Solver in Java Using BlueJ

  Machine Problem

Create a simple average solver of your grades. Then identify the grades whether pass or fail.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me at the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod City I also accepting computer repair, networking, and Arduino Project development at a very affordable price. My website is www.jakerpomperada.blogspot.com and www.jakerpomperada.com

If you like this video please click the LIKE button, SHARE, and SUBSCRIBE to my channel.

Your support on my channel is highly appreciated.

Thank you very much.







Program Listing

/* Average_Grade,java

 * Author : Jake Rodriguez Pomperada, MAED-IT, MIT

 * September 7, 2021   Tuesday   6:01 AM

 * www.jakerpomperada.blogspot.com  and www.jakerpomperada.com

 * jakerpomperada@gmail.com

 * Bacolod City, Negros Occidental Philippines.

 * 

 * Machine Problem

 * 

 * Create a simple average solver of your grades. Then identify the grades

 * whether pass or fail.

 */

import java.util.Scanner;

import java.math.RoundingMode;

import java.text.DecimalFormat;

 

public class Average_Grade {

    

     private static DecimalFormat df2 = new DecimalFormat("#.##");

     

 public static void main(String[] args) {

     

      Scanner input = new Scanner(System.in);

    

   System.out.print("Enter Subject: ");

  String subject = input.nextLine();

   

  System.out.print("Enter Prelim Grade: ");

  double prelim = input.nextDouble();

   

  System.out.print("Enter Midterm Grade: ");

  double midterm = input.nextDouble();

   

  System.out.print("Enter Final Grade: ");

  double final_grade = input.nextDouble();

   

  double average_grade = (prelim+midterm+final_grade)/3;

    

  if (average_grade >= 75) {

         

       System.out.println();

       df2.setRoundingMode(RoundingMode.DOWN);

       System.out.println("Your Final Grade is " + df2.format(average_grade) + "\n");

       System.out.print("You were successful in your " + subject + " class.");

  } else {

       System.out.println();

       df2.setRoundingMode(RoundingMode.DOWN);

       System.out.println("Your Final Grade is " + df2.format(average_grade) + "\n");

       System.out.print("You failed the " + subject + " subject.");

  }

  

 }

}




No comments:

Post a Comment