| /home/chloe/ASDV-Java/lab8_ChloeFontenot/src/main/java/com/chloefontenot/lab8_chloefontenot/ConditionalOperator4.java |
nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt
nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java
package com.chloefontenot.lab8_chloefontenot;
import java.util.Scanner;
public class ConditionalOperator4 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.print("please enter an even number: ");
int number = scan.nextInt();
System.out.print("\n" + number + ( number % 2 == 0 ? " fufills the request!" : " does not fufill the request!"));
if (number % 2 == 0)
System.out.println(" yes sir!");
else
System.out.println(" no sir!");
}
}