Sunday, June 28, 2015

Average Quizzes Solver in Java

This is a very simple program that will compute the average quizzes of the student based on five quizzes given by their teacher that I wrote in Java programming language. The code is very simple but it uses already the concepts of object oriented programming.

I hope you will find my work  useful in a sense the logic of programming is also applied in this simple program.

If you have some questions please send me an email at jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

People here in the Philippines can reach me at my mobile number 09173084360.

Thank you very much and Happy Programming.


Sample Program Output

Program Listing

import java.util.Scanner;


class five_test {
    public int find_five_average(int a, int b, int c, int d, int e)
    {
        int average=0;
        average=(a+b+c+d+e)/5;
        return(average);     
    }

public static void main(String args[]) {
  Scanner scan = new Scanner(System.in);
   char a;
do
    {
  // creating of an quizzes object
  
  five_test quizzes = new five_test();
      
  System.out.println();
  System.out.println("===== AVERAGE QUIZZES SOLVER =====");
  System.out.println();
  System.out.print("Enter Score on Quiz Number 1 :  ");
  int quiz_one =   scan.nextInt();
  System.out.print("Enter Score on Quiz Number 2 :  ");
  int quiz_two=   scan.nextInt();
  System.out.print("Enter Score on Quiz Number 3 :  ");
  int quiz_three =   scan.nextInt();
  System.out.print("Enter Score on Quiz Number 4 :  ");
  int quiz_four =   scan.nextInt();
  System.out.print("Enter Score on Quiz Number 5 :  ");
  int quiz_five =   scan.nextInt();
  
  System.out.println();

  System.out.print("The total average of five quizzes is " +
  quizzes.find_five_average(quiz_one,quiz_two,quiz_three,quiz_four,quiz_five)+  ".");
  System.out.println("\n\n");
  System.out.print("Do you Want To Continue (Y/N) :=> ");
   a=scan.next().charAt(0);

   } while(a=='Y'|| a=='y');
          System.out.println("\n");
          System.out.println("\t ===== END OF PROGRAM ======");
         System.out.println("\n");
 }
  
   } // End of Program



No comments:

Post a Comment