Hi, newbie to the forum
I am a beginner in java eclipse and having a problem with the program i had to write. The program ask the user to enter 9 digit then it is to produce the 9 numbers plus the 10th number. That does not happen. Any help would be appreciated thanks.
John
P/S please let me know if i posted correctly.
[highlight = java]
import java.util.Scanner;
public class Exercise3_9 {
public static void main(String[] args) {
Scanner input = new Scanner (System.in);
while (true) {
//Prompt the user to enter first 9 ISBN digits
System.out.print("Enter the first 9 digits of the ISBN: ");
int d1 = input.nextInt();
int d2 = input.nextInt();
int d3 = input.nextInt();
int d4 = input.nextInt();
int d5 = input.nextInt();
int d6 = input.nextInt();
int d7 = input.nextInt();
int d8 = input.nextInt();
int d9 = input.nextInt();
// Calculate
int d10 = ((d1 * 1) + (d2 * 2) + (d3 * 3) + (d4 * 4) + (d5 * 5) + (d6
* 6) + (d7 * 7) + (d8 * 8) + (d9 * 9))% 11;
if (d10 ==10)
System.out.println("The ISBN-10 number is " + "x");
else
System.out.println("The ISBN-10 number is " + "");
System.out.println();
}
}
}
[/highlight]