@@ -0,0 +1,1336 @@
+/**%0A * Purpose: Enter a number and have the program %0A * generate PI up to that many decimal places.%0A */%0Apackage findPiToNthLimit;%0A%0A/**%0A * @author Julian D. Quitian%0A * @date 6/16/2015%0A */%0A%0Aimport java.util.Scanner;%0A%0Apublic class FindPiToNthLimit %7B%0A%0A%09/**%0A%09 * %0A%09 */%0A%09public FindPiToNthLimit()%7B%7D%0A%09%0A%09/**%0A%09 * @param limit Number of decimal places to limit PI to%0A%09 * @return String %223%22 if limit is 0%0A%09 * @return String formattedPI otherwise.%0A%09 */%0A%09public static String formatPI(int limit)%0A%09%7B%0A%09%09if(limit == 0)%0A%09%09%7B%0A%09%09%09return %223%22;%0A%09%09%7D%0A%09%09String formattedPI;%0A%09%09String PIWord = Double.toString(Math.PI);%0A%09%09formattedPI = PIWord.substring(0, limit + 2);%0A%09%09return formattedPI;%0A%09%7D%0A%0A%09public static void main(String%5B%5D args) %0A%09%7B%0A%09%09int limit = 0;%0A%09%09Scanner in = new Scanner(System.in);%0A%09%09%0A%09%09System.out.println(%22Hello!%22);%0A%09%09System.out.println(%22To how many decimal places would you like %22%0A%09%09%09%09+ %22to limit PI?(Max. 15)%22);%0A%09%09//Used to assure that input is an integer between 0 and 15.%09%09%0A%09%09do%7B%0A%09%09%09System.out.println(%22Please enter a positive number less than 16%22);%0A%09%09%09while(!in.hasNextInt())%7B%0A%09%09%09%09System.out.println(%22Please enter a positive number less than 16%22);%0A%09%09%09%09in.next();%0A%09%09%09%7D%0A%09%09%09limit=in.nextInt();%0A%09%09%7Dwhile(limit %3C 0 %7C%7C limit %3E 15);%0A%0A%09%09%0A%09%09//Close Scanner in%0A%09%09in.close();%0A%09%09%0A%09%09System.out.println(%22PI formatted to your needs: %22 + formatPI(limit));%09%09%0A%09%7D%0A%7D%0A

Create FindPiToNthLimit.java