0

I am working on a program that first prompts the user for how many vacations they want to take & then asks them the name of the vacation spot until the number of vacations is reached. I need to return the input from the first question and then return the names of the vacation spots into an array. Later I will populate the array with prices but I cant get this first part to compile. Can someone show me what i'm doing wrong? The compiler says I have an error of "cannot find symbol" where I receive the next line in the vacations spot method and when I try to return the array.

import java.util.Scanner;

public class OrozcoBLE62 
{
  private static Scanner input = new Scanner(System.in);
  private static int size=0; 

  public static void main(String[] args) 
  { 

    String[]vacationsArray = new String[size];

    arraySize();
    vacationSpots(size);

  } // end of main method

  public static int arraySize()
  {
   System.out.printf("How many vacations do you want to take?");
   size = input.nextInt();
   input.nextLine();

   return size; 

  } // end of array size

  public static String vacationSpots(int size)
  {
    for(int counter=0; counter == size; counter++)
    {
    System.out.printf("Enter name of vacation spot: ");
    vacationsArray[counter] = input.nextLine();

    return vacationsArray[counter];
    }// end of for loop
  } // end of vacationSpots


} // end of class
borozco94
  • 23
  • 3

0 Answers0