Modify the student class presented in this chapter as follows

Modify the Student class presented in this chapter as adheres to.Each student object have to additionally contain the scores for three tests.Provide a constructor that sets all circumstances values based onparameter values. Overfill the constructor such that each testscore is assumed to be initially zero. Provide a method calledsetTestScore that accepts 2 parameters: the test number (1via 3) and also the score.

You watching: Modify the student class presented in this chapter as follows

See more: It Is Necessary To Pay Attention To Suffixes Because They, Mtel 54 (Study

See more: What Are You Most Excited About This School Year, 5 Reasons To Get Excited For The New School Year

Also carry out a method called getTestScorethat accepts the test number and returns the correct score.Provide a technique referred to as average that computes and returns theaverage test score for this student. Modify the toString methodsuch that the test scores and average are consisted of in thedescription of the student. Modify the driver course major technique toexercise the brand-new Student methods.

Address ClassStudent ClassStudentBody Class

//********************************************************************// Author: Lewis/Loftus//// Represents a street attend to.//********************************************************************

public course Addresspersonal String streetAddress, city, state;private lengthy zipCode;

//-----------------------------------------------------------------// Constructor: Sets up this attend to through the mentioned data.//-----------------------------------------------------------------public Address (String street, String town, String st, longzip)streetAddress = street;city = town;state = st;zipCode = zip;

//-----------------------------------------------------------------// Returns a description of this Address object.//-----------------------------------------------------------------public String toString()String result;

outcome = streetAddress + "n";result += city + ", " + state + " " + zipCode;

rerotate result;

//********************************************************************// Author: Lewis/Loftus//// Represents a college student.//********************************************************************

public class Studentexclusive String firstName, lastName;exclusive Address homeAddress, schoolAddress;

//-----------------------------------------------------------------// Constructor: Sets up this student with the specifiedvalues.//-----------------------------------------------------------------public Student (String initially, String last, Address house,Address school)firstName = first;lastName = last;homeAddress = home;schoolAddress = school;

//-----------------------------------------------------------------// Returns a string summary of this Student object.//-----------------------------------------------------------------public String toString()String result;

outcome = firstName + " " + lastName + "n";result += "Home Address:n" + homeAddress + "n";outcome += "School Address:n" + schoolAddress;

return result;

//********************************************************************// Author: Lewis/Loftus//// Demonstrates the usage of an accumulation class.//********************************************************************

public course StudentBody{//-----------------------------------------------------------------// Creates some Address and Student objects and also prints them.//-----------------------------------------------------------------public static void main (String<> args){Address school = brand-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);

Address mHome = brand-new Address ("123 Main Street", "Euclid","OH",44132);Student marsha = new Student ("Marsha", "Jones", mHome,school);