34 lines
877 B
Java
34 lines
877 B
Java
/*
|
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
|
|
*/
|
|
package practiceexam2;
|
|
|
|
import java.util.Scanner;
|
|
|
|
/**
|
|
*
|
|
* @author caleb
|
|
*/
|
|
public class AgesOf3Daughters {
|
|
public static void main(String[] args)
|
|
{
|
|
// Create scanner
|
|
Scanner input = new Scanner(System.in);
|
|
int product = 0, sum;
|
|
|
|
while (product != -1) {
|
|
System.out.print("Enter the product and then the sum of the ages of the 3 daughters or -1 to quit: ");
|
|
product = input.nextInt();
|
|
sum = input.nextInt();
|
|
|
|
if (product % 3 == 0) {
|
|
|
|
}
|
|
else {
|
|
System.out.println("Invalid input");
|
|
}
|
|
}
|
|
}
|
|
}
|