Need help converting js to C

Hi!

Original js script:

#pragma strict
#pragma implicit
#pragma downcast

var ballsArray:Transform[];

private var gtime:float=0.0;
var instantiateSpeed:float=0.3;

function Update () 
{
	gtime += Time.deltaTime;
	if(gtime >= instantiateSpeed)
	{
		var random=Mathf.Round(Random.Range(-0.4,(ballsArray.length-0.6))); //this gives random number from 0 to balls amount
		var ball=Instantiate(ballsArray[random], Vector3(Random.Range(-0.8 , 1.3) , transform.position.y , 0.0), transform.rotation)as Transform; // instantiate random ball
		ball.parent=transform; 
		gtime=0.0;
 	}
 	
}

Converted to C#:

using UnityEngine;
using System.Collections;

public class test : MonoBehaviour {

Transform[] ballsArray;
private float gtime=0.0f;
float instantiateSpeed=0.3f;

void Update (){
	gtime += Time.deltaTime;
	if(gtime >= instantiateSpeed)
	{
		float random=Mathf.Round(Random.Range(-0.4f,(ballsArray.length-0.6f))); //this gives random number from 0 to balls amount
		Transform ball=Instantiate(ballsArray[random],new Vector3(Random.Range(-0.8f , 1.3f) , transform.position.y , 0.0f), transform.rotation)as Transform; // instantiate random ball
		ball.parent=transform; 
		gtime=0.0f;
 	}
 	
}

}

got errors with

this two lines:

float random=Mathf.Round(Random.Range(-0.4f,(ballsArray.length-0.6f)));
Transform ball=Instantiate(ballsArray[random],new Vector3(Random.Range(-0.8f , 1.3f) , transform.position.y , 0.0f), transform.rotation)as Transform;

Length not length

ballsArray[(int)random]