You are on page 1of 2

Dacio, Joshua Andrei D.

11/20/2020
BSIT/3rdYear SIR JAVIER
181C-10639 Exercise 2.3.3a

/**

* Copyright @2020

* Joshua Andrei D. Dacio

* 11/20/2020

* User input using Scanner method*/

import java.util.*;

public class UserInputDemo3 {

public static void main(String[] args) {

//declare an object class name sc

Scanner sc = new Scanner(System.in);

//System.in is a standard input stream

//display quiz1, quiz2, quiz3

System.out.println("\n\t\t Compute Quizzes \n\n");

//input quiz1, quiz2, quiz3

System.out.print("Encode Quiz 1: ");

double q1 = sc.nextDouble();//reads double input quiz 1

System.out.print("Encode Quiz 2: ");

double q2 = sc.nextDouble();//reads double input quiz 2

System.out.print("Encode Quiz 3: ");

double q3 = sc.nextDouble();//reads double input quiz 3

//declare a variable name ave

//compute quiz1 + quiz2 + quiz3


Dacio, Joshua Andrei D. 11/20/2020
BSIT/3rdYear SIR JAVIER
181C-10639 Exercise 2.3.3a
double ave = (q1 + q2 + q3)/3;

//display firstnumber, secondnumber

System.out.println("\n\t\t Quizzes \n\n");

System.out.println("Quiz 1 : " + q1);

System.out.println("Quiz 2 : " + q2);

System.out.println("Quiz 3 : " + q3);

System.out.println("Your grade quiz average: " + ave);

}//End of main method

}//End of UserInputDemo3 Class

You might also like