I need to prompt for the 5 properties, then take the test scores and get the average of test 1, 2, and 3 and then display the name and average. I can't it to display or run the function. What is wrong with my code?
function Student(_firstName, _lastName, _t1, _t2, _t2){
this.firstName = _firstName ;
this.lastName = _lastName ;
this.test1 = _t1 ;
this.test2 = _t2 ;
this.test3 = _t3 ;
this.fullName = function() { return this.firstName + " " + this.lastName } ;
this.calcAverage = function() { return (this.test1 + this.test2 + this.test3) / 3 } ;
}
var name1 = prompt("Enter the first name:") ;
var name2 = prompt("Enter the last name:") ;
var te1 = parseInt(prompt("Enter the first test score:")) ;
var te2 = parseInt(prompt("Enter the second test score:")) ;
var te3 = parseInt(prompt("Enter the third test score:")) ;
var person = new Student(name1, name2, te1, te2, te3) ;
document.write(+name1+ " " +name2+ " " + person.calcAverage() +) ;