Machine Problem

Write a Java program that will ask the user to give grades in quizzes, assignments, activities, and prelim exams, and then the program will compute the prelim grade  of the student, and display the result on the screen.

  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.

Program Listing

package test;

/*
* 
* 
* Jake Rodriguez Pomperada, MAED-IT, MIT
* www.jakerpomperada.com  and www.jakerpomperada.blogspot.com
* jakerpomperada@gmail.com
* Bacolod City, Negros Occidental Philippines
* November 7, 2021  Sunday   8:36 AM
* 
* Machine Problem
* 
* Write a Java program that will ask the user to give grades in quizzes, assignments,
* activities, and prelim exams, and then the program will compute the prelim grade
* of the student, and display the result on the screen.
* 
*/


import javax.swing.*;
import javax.swing.JOptionPane;

public class Prelim_Grade {


public static void main(String args[]) {

final JPanel panel = new JPanel();
String input1,input2,input3,input4;

double quiz=0.00, assignment=0.00;
double activities=0.00, prelim_exam=0.00;

double compute=0.00;

String reply="n";

do
{


    JOptionPane.showMessageDialog(panel, "               Prelim Grade Solver in Java   \n\n"
    	    + "                              Created By     \n\n"
    	    + "Prof. Jake Rodriguez Pomperada, MAED-IT, MIT\n\n", "About This Program",
        JOptionPane.INFORMATION_MESSAGE);
    
input1 = JOptionPane.showInputDialog(null,"Enter  Quiz Grade :");
quiz=Double.parseDouble(input1);	
	
input2 = JOptionPane.showInputDialog(null,"Enter Assignment Grade :  ");
assignment=Double.parseDouble(input2);

input3 = JOptionPane.showInputDialog(null,"Enter Activites Grade : ");
activities=Double.parseDouble(input3);


input4 = JOptionPane.showInputDialog(null,"Enter Prelim Exam Grade : ");
prelim_exam=Double.parseDouble(input4);


compute = (quiz * 0.20) + (assignment * 0.10) + (activities * 0.30) + (prelim_exam * 0.40);

JOptionPane.showMessageDialog(null,"Prelim Grade : " + Math.round(compute) );

	reply =	JOptionPane.showInputDialog(null,"Try Again? (press y or n) ");
	}while (reply.matches("y") || reply.matches("Y") );

JOptionPane.showMessageDialog(null,"End of Program"  );


	}
}

Leave a Reply

Your email address will not be published.