Advertisement
Guest User

Untitled

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