Advertisement
Guest User

County Names

a guest
Apr 26th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.91 KB | None | 0 0
  1. import java.util.Scanner;
  2. /*
  3. * Mattie Richardson
  4. * 4th Period
  5. * Computer Science
  6. * County Names
  7. */
  8.  
  9. public class Program {
  10.  
  11. public static void main(String[] args) {
  12.  
  13.  
  14. /*Different County Names*/
  15. String [] counties = {"Arkansas\t", "Ashley\t", "Baxter\t", "Benton\t", "Boone\t", "Bradley\t", "Calhoun\t",
  16. "Carroll\t", "Chicot\t", "Clark\t", "Clay\t", "Cleburne\t", "Cleveland", "Columbia\t", "Conway\t",
  17. "Craighead", "Crawford\t", "Crittenden", "Cross\t", "Dallas\t", "Desha\t", "Drew\t", "Faulkner\t",
  18. "Franklin\t", "Fulton\t", "Garland\t", "Grant\t", "Greene\t", "Hempstead", "Hot Spring", "Howard\t",
  19. "Independence", "Izard\t", "Jackson\t", "Jefferson", "Johnson\t", "Lafayette", "Lawrence\t", "Lee\t",
  20. "Lincoln\t", "Little River", "Logan\t", "Lonoke\t", "Madison\t", "Marion\t", "Miller\t", "Mississippi",
  21. "Monroe\t", "Montgomery", "Nevada\t", "Newton\t", "Ouachita\t", "Perry\t", "Phillips\t", "Pike\t",
  22. "Poinsett\t", "Polk\t", "Pope\t", "Prairie\t", "Pulaski\t", "Randolph\t", "Saline\t", "Scott\t", "Searcy\t",
  23. "Sebastian", "Sevier\t", "Sharp\t", "St. Francis", "Stone\t", "Union\t", "Van Buren", "Washington",
  24. "White\t", "Woodruff\t", "Yell"};
  25. Scanner sc = new Scanner(System.in);
  26.  
  27. /* How many different columns there are*/
  28. System.out.println("How many columns?");
  29. int input = sc.nextInt();
  30.  
  31. int i = 0;
  32. for(int c = 0; c < counties.length; c++) {
  33.  
  34. System.out.print(counties[c] + "\t");
  35.  
  36. i = i + 1;
  37.  
  38. if(i == input ) {
  39.  
  40. i = 0;
  41.  
  42. System.out.println();
  43.  
  44. }
  45.  
  46.  
  47.  
  48. }
  49. }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement