public class Ratuski_Nicholas_A5Q1 { /* * PURPOSE: calculate population change */ //Count between start and end public static int countInRange(String text, char start, char end) { char[] textArray = text.toCharArray(); //Convert the string to an array int count; //How much in range? count = 0; for (int i=0;i= (int)start) && ((int)textArray[i] <= (int)end)) { count++; } } return count; } //Count between start and end public static long[] readLongData(int years, int start) { String temp; int numDigits; int startYear; long[] yearArray = new long[years]; for (int i=0; i 0) { numSpaces = numSpaces - numStars; System.out.println((year+i)+"|"+getSpaces(20)+"|"+stars+getSpaces(numSpaces)); } else { System.out.println((year+i)+"|"+getSpaces(20)+"|"); } } } public static void main (String [] args) { String temp; //temporary input string String name; //city name int numCities; //how many cities to work with? int numYears; //amount of years int startYear; //year to start at long[] yearArray; //array of years double[] percentArray; //array of percent changes numCities = 1; temp = JOptionPane.showInputDialog ("Enter how many cities you want to calculate the population changes for."); numCities = Integer.parseInt(temp); for (int i=0; i