Soluc pc2
Soluc pc2
Soluc pc2
***********************************************************
package practica2;
/**
*
* @author Student11
*/
public class Main {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
}
}
**********************************************************
package preguntas;
/**
*
* @author Student11
*/
public class Auto extends Vehiculo {
public Auto(){
}
public Auto(int codigo, String placa,
String tipo, String modelo, int a�o_fabricacion, String propietario,
double precio){
this.placa = placa;
this.propietario = propietario;
this.precio = precio;
this.modelo=modelo;
double d=0.0;
if (getA�o_fabricacion()==2008){
d=precio-precio*(0.08/2);
}
if (getA�o_fabricacion()==2007){
d=precio-precio*(0.15);
}
if (getA�o_fabricacion()==2006){
d=precio-precio*(0.17/1.5);
}
if (getA�o_fabricacion()<2006){
d=precio-precio*((2006-getA�o_fabricacion())*0.17/1.5);
return d;
}
**********************************************************************
package preguntas;
/**
*
* @author Student11
*/
public class Prueba {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Auto a= new Auto(1223,"QQ2056","volocho","escarabajo",1999,"alfredo
enrique",999);
a.Verdatos();
}
****************************************************************************
package preguntas;
/**
*
* @author Student11
*/
public class Vehiculo {