Search This Blog

Friday, January 27

!ANSWER 3! Notebook

public class Notebook extends Computer {
 static int dScreenSize;
 
 public Notebook(String maufacturer, String model, int drivecap, int screenSize, String color, double price) {
  super(maufacturer, model, drivecap, color, price);
  dScreenSize = screenSize;
 }
 public int getscreensize(){
  return dScreenSize;
 }
 public void setscreensize(int screenSize){
  dScreenSize = screenSize;
 }
 @Override
 public String toString() {
  return String.format("\nDesktop Computer\n\nManufacturer: %s\nModel: %s\nCPU:\n\tType: %s" +
    "\n\tSpeed: %f\n\tCache: %d\n\tFSB: %d\nHard Drive: %d\nScreen Size: %d\nColor: %s\nPrice: %f\n", 
    getmanufacturer(), getmodel(), cpu.gettype(), cpu.getspeed(), cpu.getcache(), cpu.getFSB(), gethardDrive(), 
    this.getscreensize(), getcolor(), getprice());
 }
}

No comments:

Post a Comment