import javax.swing.*;

public class vehicle 
{
//valid vehicle types bus,truck,minitruck,minivan,auto  
public String vehicletype;
public String brandName;
public double power; //KW olarak
public String color;
public double weight;            //yüksüz net ağırlık
//kurucu metodlar

public vehicle()
{vehicletype="not defined";
brandName="not defined";
power=0;
color="not defined";
weight=0;
}

public vehicle(String i_vehicletype,String i_brandName,double i_motor,String i_color,double i_weight)
{//vehicle type "bus","truck","mini truck","mini bus","auto","tır"
//if not define as "not defined" 
if(i_vehicletype.equals("truck") || 
   i_vehicletype.equals("minitruck") || 
   i_vehicletype.equals("bus")||
   i_vehicletype.equals("minibus")||
   i_vehicletype.equals("auto") || 
   i_vehicletype.equals("motorcycle") || 
   i_vehicletype.equals("bicycle") || 
   i_vehicletype.equals("off road vehicle")
   )
{vehicletype=i_vehicletype;}
else
{vehicletype="not defined";}
brandName=i_brandName;
power=i_motor;
color=i_color;
weight=i_weight;
}

public vehicle(vehicle A)
{//gerekli tanımları yap
vehicletype=A.vehicletype;
brandName=A.brandName;
power=A.power;
color=A.color;
weight=A.weight;
}

public void define_vehicle(String i_vehicletype,String i_brandName,double i_motor,String i_color,double i_weight)
{//vehicle type "bus","truck","mini truck","mini bus","auto","tır"
//if not define as "not defined" 
if(i_vehicletype.equals("truck") || 
   i_vehicletype.equals("minitruck") || 
   i_vehicletype.equals("bus")||
   i_vehicletype.equals("minibus")||
   i_vehicletype.equals("auto") || 
   i_vehicletype.equals("motorcycle") || 
   i_vehicletype.equals("bicycle") || 
   i_vehicletype.equals("off road vehicle"))
   {vehicletype=i_vehicletype;}
else
{vehicletype="not defined";}
brandName=i_brandName;
power=i_motor;
color=i_color;
weight=i_weight;
}

public String toString()
{String s1="";
s1+="Vehicle Type : "+vehicletype+"\n";
s1+="Brand Name : "+brandName+"\n";
s1+="Motor Power : "+power+" KW\n";
s1+="Color : "+color+"\n";
s1+="Weight : "+weight+" kg\n";
return s1;//gerekli tanımları yap
}

public void outputwindow()
{
String s1="Vehicle class output window";	
JOptionPane.showMessageDialog(null,toString(),s1, JOptionPane.PLAIN_MESSAGE);	
}
  
}