Search This Blog

Tuesday, January 24

!ANSWER 3! Computer Class

import java.util.ArrayList;
import java.util.Scanner;


public abstract class Computer {
 private String cManufacturer;
 private String cModel;
 private String cColor;
 private int hardDrive;
 private double cPrice;
 protected CPU cpu;
 private boolean isPowerOn = false;
 
 public Computer (String maufacturer,String model, int drivecap, String color, double price){
  cManufacturer = maufacturer;
  cModel = model;
  hardDrive = drivecap;
  cColor = color;
  cPrice = price;

 }
 public String getmanufacturer()
 {
  return cManufacturer; 
 }
 public void setmanufacturer(String manufacturer){
  cManufacturer = manufacturer;
 }
 public String getmodel()
 {
  return cModel; 
 }
 public void setmodel(String model){
  cModel = model;
 }
 public int gethardDrive()
 {
  return hardDrive; 
 }
 public void sethardDrive(int drivecap){
  hardDrive = drivecap;
 }
 public String getcolor()
 {
  return cColor; 
 }
 public void setcolor(String color){
  cColor = color;
 }
 public double getprice(){
  return cPrice;  
 }
 public void setprice(double price){
  cPrice = price;
 }
 public void setCPU(CPU cCpu){
  cpu = cCpu;
 }
 
 public boolean getpower(){
  return isPowerOn;
 }
 
 public void start(){
  isPowerOn = true;
 }
 public void shutdown(){
  isPowerOn = false;
 }
 
}

No comments:

Post a Comment