Getting a "java.lang.ArrayIndexOutOfBoundsException: 160" thrown at me for a terminal velocity

The problem is basically analyzing what your velocity will be at a specified time step, mass, cross sectional area, drag coefficient, density, and time
The problem then wants me to store the velocity and the time in two separate column arrays, and then output it to some file to be used in Excel. So for example, i specify I want the fall to last 15 seconds at a time step of 0.1 seconds, starting at 0 seconds, the corresponding velocity would be 0, and then the next time would be 0.1 with a new velocity of some value, and so on and so forth, with each value being stored in an array. Yet I’ve been having trouble getting my velocities into an array
Here’s my code:

import java.util.*;
import java.io.*;

public class Skydive

public static void main (String[] args) {
    Scanner kb = new Scanner(System.in);
    double input;
    double density = 1.14; //units kg/m^3
    double gravity = 9.81; //defining preset variables, units m/s^2
    //double  velocity;
    double crossA;
    double mass;
    double dragCoeff;
    double timeStep;
    double time;

    do    {
        System.out.println("Enter the diver's mass");
        input = kb.nextDouble();
        mass= input;
    }
    while (input <=0); 

    System.out.println("Invalid mass, mass cannot be 0 or negative");

    do  {
        System.out.println("Enter a cross sectional area");
        input = kb.nextDouble();
        crossA=input;
    }
    while (input <=0);
    System.out.println("Error, cross sectional area cannot be negative or zero");

    do  {
        System.out.println("Enter a drag coefficient");
        input = kb.nextDouble();
        dragCoeff = input;
    }
    while (input<0);    {
    System.out.println("Drag Coefficient cannot be negative");
}
    do  {
        System.out.println("How long do you want to run the dive out to?");
        input = kb.nextDouble();
        time = input;
    }
    while (time<0);
    System.out.println("Time cannot be negative");
    do  {
        System.out.println("Enter a time step");
        input = kb.nextDouble();
        timeStep= input;
    }
    while(input<=0 || input>time);
    System.out.println("Time step cannot be zero, negative, or greater than the total dive time");

    //double[] velocity = new double[time/timeStep];

    //double velocity = 0;
    double velocity=0;
    int x = (int) (time/timeStep);
    double [] vArray = new double[x];
    int temp = 0;
    double []tArray = new double[x];
    //int x=0;
    for(double i =0; i<time; i+=timeStep)   {

        velocity =velocity + ( gravity - (dragCoeff*density*crossA/(2*mass))*velocity*velocity)*timeStep;

        vArray[temp]= velocity;
        tArray[temp] = i;
        System.out.println(tArray[temp] + "," + vArray[temp]);
        temp+=1;






        //double[] velocity = new double[time/timeStep];

    }
    String wordText;

    System.out.println("Enter a file name to export to");
    wordText= kb.next();

    PrintWriter outputStream= null;


    try {
        outputStream = new PrintWriter ( new FileOutputStream (""+ wordText +".txt"));
    }
    catch (FileNotFoundException e)  {
        System.out.println("Program could not be exported");
        System.exit(0);
    }
    }

}

`