import java.util.Scanner;
public class App {
/**
* The start point of the program
*
* @param args
*
*/
public static void main(String[] args) {
Scanner keyBoard = new Scanner(System.in);
System.out.print("Enter the number 1: ");
int billAmount = keyBoard.nextInt();
int sumEvenDigits = 0;
int sumOddDigits = 0;
while (billAmount != 0) {
int d = billAmount % 10;
if (d % 2 == 0) {
sumEvenDigits += d;
} else {
sumOddDigits += d;
}
billAmount = billAmount / 10;
}
int discountAmount = sumEvenDigits*sumOddDigits;
System.out.println(discountAmount);
keyBoard.close();
}
}
Comments
Leave a comment