//Character class static "toUpperCase" method ("toLowerCase") import java.util.Scanner; import java.text.DecimalFormat; public class eg21_CircleArea { public static void main(String[] args) { double radius; double area; String input; char choice; //create scanner object to read keyboard input Scanner keyboard = new Scanner(System.in); //create a DecimalFormat object DecimalFormat fmt = new DecimalFormat("0.00"); do { //guess what, I skip this... not really important for toUpperCase method System.out.print("Do you want to do this again? (Y or N) "); input = keyboard.nextLine(); choice = input.charAt(0); } while (Character.toUpperCase(choice) == 'Y'); } }