import java.util.Scanner;


//Navigate Menus: Window -> Show View -> Tasks

public class ThreeDigitNumber {

	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		
		//Get a string from the user
		System.out.print("Enter a three digit number: ");
		//FIXME: get the next "word" from the Scanner and assign it to line
		String line = "NEXT";
		
		//will become false if something goes wrong
		boolean success = true;
		
		//store the converted int value
		int intValue = 0;
		
		//did they enter the correct length
		//TODO write the condition to check if the length of line is 3.
		if(__________) {
			//FIXME get the first digit of the line and assign it to digit
			char digit = '0';
			
			//make sure it represents a numeric digit
			//TODO: check if digit is between '0' and '9'
			if(__________) {
				//FIXME: convert the digit to the int it represents
				intValue = digit;
			}
			else {
				//input error
				System.out.println(digit + " is not numeric.");
				//TODO: Something went wrong, set success to false.
				
			}
			
			//get the second digit
			digit = line.charAt(1);
			//make sure it represents a numeric digit using Character.isDigit
			//TODO: use isDigit to check if digit is numeric
			if(__________) {
				//shift the current number over 1 column (*10) and add the new digit
				intValue = 10*intValue + (digit - '0');
			}
			else {
				//input error
				System.out.println(digit + " is not numeric.");
				//TODO: Something went wrong, set success to false.
				
			}

			//process the third digit
			digit = line.charAt(2);
			//TODO: check if digit is numeric
			if(__________) {
				intValue = 10*intValue + (digit - '0');
			}
			else {
				System.out.println(digit + " is not numeric.");
				//TODO: Something went wrong, set success to false.
				
			}
		} //end if length is 3
		else {
			//length was not 3
			System.out.println("You did not enter a three digit number");
			//TODO: Something went wrong, set success to false.
			
		}
		
		//TODO: check if everything was successful
		if(__________) {
			//it was ok, print out the result
			System.out.printf("The integer value is: %d.\n", intValue);
		}
		else {
			//it was bad, don't print the result since it is wrong.
			System.out.println("The program failed.");
		}
	}

}

/*
 What input values did you use to test the program?
 TODO: Answer here.
 
 */
