public class Lab1
{
public static void main( String[] args )
{
Automobile a = new Automobile("Porsche", "911 ST", 2025, 4);
SUV s = new SUV("Subaru", "Outback", 2025, 4, 5, 6.7 );
a.getinfo();
s.getinfo();
}
}
//===================================================================
public class Automobile
{
private String make;
private String model;
private int year;
private int numWheels;
public Automobile(String mk, String md, int y, int nw)
{
make = mk;
model = md;
year = y;
numWheels = nw;
}
public void getinfo()
{
// print 'The programmer is: <your name>'
// print the 'Make: ' 'Model: ' 'Year: ' and 'Number of Wheels: '
}
}
//==================================================================
public class SUV extends Automobile
{
private int numpass;
private double cargospc;
public SUV(String mk, String md, int y, int nw, int np, double c)
{
//your code here (read instructions)
}
public void getinfo()
{
//your code here (read instructions)
}
}