0% found this document useful (0 votes)
3 views

OOP1

Uploaded by

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

OOP1

Uploaded by

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

import javax.swing.

JOptionPane;

public class GradingSystem {

public static void main(String[] args) {

String quiz1Str = JOptionPane.showInputDialog("Enter the score for Quiz


1:");
String quiz2Str = JOptionPane.showInputDialog("Enter the score for Quiz
2:");
String quiz3Str = JOptionPane.showInputDialog("Enter the score for Quiz
3:");

int quiz1 = Integer.parseInt(quiz1Str);


int quiz2 = Integer.parseInt(quiz2Str);
int quiz3 = Integer.parseInt(quiz3Str);

int average = (quiz1 + quiz2 + quiz3) / 3;

String message = " Arellano University\n" +


"<<Grading System>>\n\n" +
"Quiz 1: " + quiz1 + "\n" +
"Quiz 2: " + quiz2 + "\n" +
"Quiz 3: " + quiz3 + "\n\n" +
"Average Quiz: " + average;

// Display the output using JOptionPane


JOptionPane.showMessageDialog(null, message, "Grading System",
JOptionPane.INFORMATION_MESSAGE);
}
}

You might also like