View Single Post
  #1 (permalink)  
Old 07-24-2007, 06:11 AM
zoe zoe is offline
Member
 
Join Date: Jul 2007
Posts: 40
zoe is on a distinguished road
Help with this code, overload the constructor
I have to write a program that returns an address and also three test scores. I need to provide a constructor that sets all instance values based on parameter values. I need to overload the constructor such that each test score is assumed to be initially zero and provide a method called setTestScore that accepts two Parameters: the test number 1-3 and the score, and a method called getTestScore that accepts the test number and returns the score.

Code:
public class StudentBody { private int value; public static void main (String[] args) { Address school = new Address ("800 Lancaster Ave.", "Villanova", "PA", 19085); Address jHome = new Address ("21 Jump Street", "Lynchburg", "VA", 24551); Student john = new Student ("John", "Smith", JHome, school);
Thanks
Reply With Quote
Sponsored Links