Question: ( 2 5 points ) No Problem - Solving Required. LabHomework 9 has one GUI requirement. Using the example given of the addition of two

(25 points) No Problem-Solving Required. LabHomework9 has one GUI requirement. Using the example given of the addition of two numbers (see below). I would like each student to do a problem from earlier in the semester where we used the Scanner class but replace the Scanner input with the JOptionPane. import java.util.Scanner;
public class EvenorOdd {
/**
* @param args the command line arguments
*/
public static void main(String[] args){
Scanner input = new Scanner(System.in); // TODO code application logic here
int EoO_number;
System.out.print("Please Enter a positive integer: ");
EoO_number = input.nextInt();
if (EoO_number %2==0)
System.out.println("The number "+ EoO_number +" is even.");
else
System.out.println("The number "+ EoO_number +" is odd.");
}
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!