Wednesday, July 27, 2011

Assignment 6

Ch7, #4:
public void swapHardDrive (Computer otherComputer)
{
String temp;
temp = otherComputer.hardDrive;
otherComputer.hardDrive = this.hardDrive;
this.hardDrive = temp;
}



Ch7, #12
10
20
30
60
50



Ch8, #5:
public boolean copyTo(Car5 newCar)
{
if(this.make.isEmpty()||this.year.isEmpty()||this.color.isEmpty())
{
return false;
}
else
{
newCar.make = this.make;
newCar.year = this.year;
newCar.color = this.color;
return true;
}
}

No comments: