Hello!
I try to write a program car registration. I have two class:
1-class Car
which has (model,color,motorPower). 2-class CarTable which has an array whit 50
place(we can put the cars and print out them)
class Car{
private String model;
private String color;
private double motorPower;
public Car(String iModel, String iColor, double iMotorPower){
.......
}//methodes
public String getModel(){
public String getColor(){
public double getPower(){
* public void setColor(String ){
* public String getCar(int n){
------------------------------------------------------
class CarTable{}
private String[]carVector;
private int nbr;
public CarTable (){
carVector= new String[50];
nbr=0;{
*public .....addCar(“ model”,”color”,”power”){
---------------------------------------------------------------------------------
The test program must be like this;
Public static void main(......)
Car b1 = new Car("Benz","blue",190);
Car b2;
CarTable myTable= new CarTable();
*b2 = myTable.getCar(1);
*myTable.addCar(new Car("Volvo","red",120));
*b2.setColor("green");
----------------------------------------------------------
MY PROBLEM is the sentences which have stars(*)
How can I complate class CarTable whit addCar() methode and
Class Car whit getCar() and setColor()
thanks