1
0
This commit is contained in:
2025-10-10 02:14:54 +02:00
commit b104c861e7
32 changed files with 3649 additions and 0 deletions

8
proyecto-java/.classpath Normal file
View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="data"/>
<classpathentry kind="src" path="docs"/>
<classpathentry kind="output" path="bin"/>
</classpath>

17
proyecto-java/.project Normal file
View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>proyecto-java-evaluacion-continua-2o-cuatrimestre-ic2-lab1-yoshibv</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@@ -0,0 +1,157 @@
Manufacturer;Model;Sales in thousands;4-year resale value;Vehicle type;Price in thousands;Engine size;Horsepower;Wheelbase;Width;Length;Curb weight;Fuel capacity;Fuel efficiency;Latest Launch;Color1;Color2;Color3;Color4;Color5
Acura ;Integra ;16919;16.36;Passenger;21.5;1.8;140;101.2;67.3;172.4;2.639;13.2;28;02/02/2014;BLANCO;NEGRO;ROJO;AZUL;
Acura ;TL ;39384;19.875;Passenger;28.4;3.2;225;108.1;70.3;192.9;3.517;17.2;25;06/03/2015;BLANCO;NEGRO;ROJO;AZUL;
Acura ;CL ;14114;18.225;Passenger;29.295;3.2;225;106.9;70.6;192;3.47;17.2;26;01/04/2014;BLANCO;NEGRO;ROJO;AZUL;
Acura ;RL ;8588;29.725;Passenger;42;3.5;210;114.6;71.4;196.6;3.85;18;22;03/10/2015;BLANCO;NEGRO;ROJO;AZUL;
Audi ;A4 ;20397;22.255;Passenger;23.99;1.8;150;102.6;68.2;178;2.998;16.4;27;10/08/2015;BLANCO;NEGRO;ROJO;AZUL;
Audi ;A6 ;1878;23.555;Passenger;33.95;2.8;200;108.7;76.1;192;3.561;18.5;22;08/09/2015;BLANCO;NEGRO;ROJO;AZUL;
Audi ;A8 ;138;39;Passenger;62;4.2;310;113;74;198.2;3.902;23.7;21;27/02/2014;BLANCO;GRIS;ROJO;AZUL;
BMW ;323i ;19747;0.0;Passenger;26.99;2.5;170;107.3;68.4;176;3.179;16.6;26;28/06/2015;BLANCO;GRIS;ROJO;AZUL;
BMW ;328i ;9231;28.675;Passenger;33.4;2.8;193;107.3;68.5;176;3.197;16.6;24;29/01/2014;BLANCO;GRIS;ROJO;AZUL;
BMW ;528i ;17527;36.125;Passenger;38.9;2.8;193;111.4;70.9;188;3.472;18.5;25;04/04/2015;BLANCO;GRIS;ROJO;AZUL;
Buick ;Century ;91561;12.475;Passenger;21.975;3.1;175;109;72.7;194.6;3.368;17.5;25;11/02/2015;BLANCO;GRIS;ROJO;AZUL;
Buick ;Regal ;3935;13.74;Passenger;25.3;3.8;240;109;72.7;196.2;3.543;17.5;23;09/03/2015;BLANCO;GRIS;ROJO;AZUL;
Buick ;Park Avenue ;27851;20.19;Passenger;31.965;3.8;205;113.8;74.7;206.8;3.778;18.5;24;23/03/2014;BLANCO;GRIS;ROJO;AZUL;
Buick ;LeSabre ;83257;13.36;Passenger;27.885;3.8;205;112.2;73.5;200;3.591;17.5;25;23/07/2015;BLANCO;GRIS;ROJO;AZUL;
Cadillac ;DeVille ;63729;22.525;Passenger;39.895;4.6;275;115.3;74.5;207.2;3.978;18.5;22;23/02/2014;BLANCO;GRIS;ROJO;AZUL;GRIS
Cadillac ;Seville ;15943;27.1;Passenger;44.475;4.6;275;112.2;75;201;0;18.5;22;29/04/2015;BLANCO;GRIS;ROJO;AZUL;GRIS
Cadillac ;Eldorado ;6536;25.725;Passenger;39.665;4.6;275;108;75.5;200.6;3.843;19;22;27/11/2015;BLANCO;NEGRO;GRIS;AZUL;GRIS
Cadillac ;Catera ;11185;18.225;Passenger;31.01;3;200;107.4;70.3;194.8;3.77;18;22;28/09/2015;BLANCO;NEGRO;GRIS;AZUL;GRIS
Cadillac ;Escalade ;14785;0.0;Car;46.225;5.7;255;117.5;77;201.2;5.572;30;15;17/04/2014;BLANCO;NEGRO;GRIS;AZUL;GRIS
Chevrolet ;Cavalier ;145519;9.25;Passenger;13.26;2.2;115;104.1;67.9;180.9;2.676;14.3;27;17/08/2015;BLANCO;NEGRO;GRIS;AZUL;GRIS
Chevrolet ;Malibu ;135126;11.225;Passenger;16.535;3.1;170;107;69.4;190.4;3.051;15;25;19/03/2014;BLANCO;AMARILLO;GRIS;AZUL;GRIS
Chevrolet ;Lumina ;24629;10.31;Passenger;18.89;3.1;175;107.5;72.5;200.9;3.33;16.6;25;24/05/2015;BLANCO;AMARILLO;GRIS;AZUL;GRIS
Chevrolet ;Monte Carlo ;42593;11.525;Passenger;19.39;3.4;180;110.5;72.7;197.9;3.34;17;27;22/12/2015;BLANCO;AMARILLO;GRIS;AZUL;GRIS
Chevrolet ;Camaro ;26402;13.025;Passenger;24.34;3.8;200;101.1;74.1;193.2;3.5;16.8;25;23/10/2015;BLANCO;AMARILLO;GRIS;AZUL;GRIS
Chevrolet ;Corvette ;17947;36.225;Passenger;45.705;5.7;345;104.5;73.6;179.7;3.21;19.1;22;05/12/2014;BLANCO;AMARILLO;GRIS;AZUL;AMARILLO
Chevrolet ;Prizm ;32299;9.125;Passenger;13.96;1.8;120;97.1;66.7;174.3;2.398;13.2;33;09/11/2015;BLANCO;AMARILLO;GRIS;AZUL;AMARILLO
Chevrolet ;Metro ;21855;5.16;Passenger;9.235;1;55;93.1;62.6;149.4;1.895;10.3;45;13/04/2014;BLANCO;AMARILLO;ROJO;AZUL;AMARILLO
Chevrolet ;Impala ;107995;0.0;Passenger;18.89;3.4;180;110.5;73;200;3.389;17;27;18/06/2015;BLANCO;AMARILLO;ROJO;AZUL;AMARILLO
Chrysler ;Sebring Coupe ;7854;12.36;Passenger;19.84;2.5;163;103.7;69.7;190.9;2.967;15.9;24;16/01/2014;BLANCO;AMARILLO;ROJO;AZUL;AMARILLO
Chrysler ;Sebring Conv. ;32775;14.18;Passenger;24.495;2.5;168;106;69.2;193;3.332;16;24;17/11/2015;BLANCO;AMARILLO;ROJO;GRIS;AMARILLO
Chrysler ;Concorde ;31148;13.725;Passenger;22.245;2.7;200;113;74.4;209.1;3.452;17;26;06/06/2014;BLANCO;AMARILLO;ROJO;GRIS;AMARILLO
Chrysler ;Cirrus ;32306;12.64;Passenger;16.48;2;132;108;71;186;2.911;16;27;10/06/2015;BLANCO;AMARILLO;ROJO;GRIS;AMARILLO
Chrysler ;LHS ;13462;17.325;Passenger;28.34;3.5;253;113;74.4;207.7;3.564;17;23;05/08/2014;BLANCO;AMARILLO;ROJO;GRIS;AMARILLO
Chrysler ;300M ;30696;0.0;Passenger;29.185;3.5;253;113;74.4;197.8;3.567;17;23;02/10/2014;BLANCO;NEGRO;ROJO;GRIS;AMARILLO
Dodge ;Neon ;76034;7.75;Passenger;12.64;2;132;105;74.4;174.4;2.567;12.5;29;12/12/2015;BLANCO;NEGRO;ROJO;GRIS;AMARILLO
Dodge ;Avenger ;4734;12.545;Passenger;19.045;2.5;163;103.7;69.1;190.2;2.879;15.9;24;07/01/2014;BLANCO;NEGRO;ROJO;GRIS;AMARILLO
Dodge ;Stratus ;71186;10.185;Passenger;20.23;2.5;168;108;71;186;3.058;16;24;31/10/2015;BLANCO;NEGRO;ROJO;GRIS;
Dodge ;Intrepid ;88028;12.275;Passenger;22.505;2.7;202;113;74.7;203.7;3.489;17;0;06/02/2014;BLANCO;NEGRO;AMARILLO;GRIS;
Dodge ;Viper ;916;58.47;Passenger;69.725;8;450;96.2;75.7;176.7;3.375;19;16;08/07/2015;BLANCO;NEGRO;AMARILLO;AZUL;
Dodge ;Ram Pickup ;227061;15.06;Car;19.46;5.2;230;138.7;79.3;224.2;4.47;26;17;03/06/2014;BLANCO;NEGRO;AMARILLO;AZUL;
Dodge ;Ram Wagon ;16767;15.51;Car;21.315;3.9;175;109.6;78.8;192.6;4.245;32;15;01/06/2014;BLANCO;NEGRO;AMARILLO;AZUL;
Dodge ;Ram Van ;31038;13.425;Car;18.575;3.9;175;127.2;78.8;208.5;4.298;32;16;26/07/2014;BLANCO;NEGRO;AMARILLO;AZUL;
Dodge ;Dakota ;111313;11.26;Car;16.98;2.5;120;131;71.5;215;3.557;22;19;25/11/2015;BLANCO;NEGRO;AMARILLO;AZUL;
Dodge ;Durango ;101323;0.0;Car;26.31;5.2;230;115.7;71.7;193.5;4.394;25;17;27/06/2014;BLANCO;NEGRO;AMARILLO;AZUL;
Dodge ;Caravan ;181749;12.025;Car;19.565;2.4;150;113.3;76.8;186.3;3.533;20;24;09/01/2015;BLANCO;NEGRO;AMARILLO;AZUL;
Ford ;Escort ;70227;7.425;Passenger;12.07;2;110;98.4;67;174.7;2.468;12.7;30;31/03/2014;BLANCO;NEGRO;AMARILLO;AZUL;
Ford ;Mustang ;113369;12.76;Passenger;21.56;3.8;190;101.3;73.1;183.2;3.203;15.7;24;31/01/2014;BLANCO;NEGRO;AMARILLO;AZUL;
Ford ;Contour ;35068;8.835;Passenger;17.035;2.5;170;106.5;69.1;184.6;2.769;15;25;20/08/2014;BLANCO;NEGRO;AMARILLO;AZUL;
Ford ;Taurus ;245815;10.055;Passenger;17.885;3;155;108.5;73;197.6;3.368;16;24;20/12/2015;BLANCO;NEGRO;AMARILLO;AZUL;
Ford ;Focus ;17567;0.0;Passenger;12.315;2;107;103;66.9;174.8;2.564;13.2;30;22/07/2014;BLANCO;NEGRO;AMARILLO;AZUL;
Ford ;Crown Victoria ;63403;14.21;Passenger;22.195;4.6;200;114.7;78.2;212;3.908;19;21;26/09/2015;BLANCO;NEGRO;ROJO;AZUL;
Ford ;Explorer ;276747;16.64;Car;31.93;4;210;111.6;70.2;190.7;3.876;21;19;25/04/2014;BLANCO;NEGRO;ROJO;AMARILLO;
Ford ;Windstar ;155787;13.175;Car;21.41;3;150;120.7;76.6;200.9;3.761;26;21;25/02/2014;BLANCO;NEGRO;ROJO;AMARILLO;
Ford ;Expedition ;125338;23.575;Car;36.135;4.6;240;119;78.7;204.6;4.808;26;16;14/09/2014;BLANCO;NEGRO;ROJO;AMARILLO;
Ford ;Ranger ;22065;7.85;Car;12.05;2.5;119;117.5;69.4;200.7;3.086;20;23;14/01/2014;BLANCO;NEGRO;ROJO;AMARILLO;
Ford ;F-Series ;540561;15.075;Car;26.935;4.6;220;138.5;79.1;224.5;4.241;25.1;18;16/08/2014;BLANCO;NEGRO;ROJO;AMARILLO;
Honda ;Civic ;199685;9.85;Passenger;12.885;1.6;106;103.2;67.1;175.1;2.339;11.9;32;21/10/2015;BLANCO;NEGRO;ROJO;AMARILLO;
Honda ;Accord ;230902;13.21;Passenger;15.35;2.3;135;106.9;70.3;188.8;2.932;17.1;27;20/05/2014;BLANCO;NEGRO;ROJO;AMARILLO;
Honda ;CR-V ;73203;17.71;Car;20.55;2;146;103.2;68.9;177.6;3.219;15.3;24;21/03/2014;BLANCO;NEGRO;ROJO;AMARILLO;
Honda ;Passport ;12855;17.525;Car;26.6;3.2;205;106.4;70.4;178.2;3.857;21.1;19;10/09/2014;BLANCO;NEGRO;ROJO;AMARILLO;
Honda ;Odyssey ;76029;19.49;Car;26;3.5;210;118.1;75.6;201.2;4.288;20;23;02/08/2014;BLANCO;NEGRO;ROJO;AMARILLO;
Hyundai ;Accent ;41184;5.86;Passenger;9.699;1.5;92;96.1;65.7;166.7;2.24;11.9;31;09/10/2014;BLANCO;NEGRO;ROJO;AMARILLO;
Hyundai ;Elantra ;66692;7.825;Passenger;11.799;2;140;100.4;66.9;174;2.626;14.5;27;15/11/2015;BLANCO;NEGRO;ROJO;AMARILLO;
Hyundai ;Sonata ;2945;8.91;Passenger;14.999;2.4;148;106.3;71.6;185.4;3.072;17.2;25;14/06/2014;BLANCO;NEGRO;ROJO;AMARILLO;
Infiniti ;I30 ;23713;19.69;Passenger;29.465;3;227;108.3;70.2;193.7;3.342;18.5;25;15/04/2014;BLANCO;NEGRO;ROJO;AZUL;
Jaguar ;S-Type ;15467;0.0;Passenger;42.8;3;240;114.5;71.6;191.3;3.65;18.4;21;11/03/2014;BLANCO;NEGRO;ROJO;AZUL;
Jeep ;Wrangler ;55557;13.475;Car;14.46;2.5;120;93.4;66.7;152;3.045;19;17;03/04/2014;BLANCO;NEGRO;ROJO;AZUL;
Jeep ;Cherokee ;80556;13.775;Car;21.62;4;190;101.4;69.4;167.5;3.194;20;20;10/05/2014;BLANCO;NEGRO;ROJO;AZUL;
Jeep ;Grand Cherokee ;15704;18.81;Car;26.895;4;195;105.9;72.3;181.5;3.88;20.5;19;12/10/2015;BLANCO;NEGRO;ROJO;AZUL;
Lexus ;ES300 ;24072;26.975;Passenger;31.505;3;210;105.1;70.5;190.2;3.373;18.5;23;07/09/2014;BLANCO;NEGRO;ROJO;AZUL;
Lexus ;GS300 ;12698;32.075;Passenger;37.805;3;225;110.2;70.9;189.2;3.638;19.8;23;05/10/2014;BLANCO;NEGRO;ROJO;AZUL;
Lexus ;GS400 ;3334;0.0;Passenger;46.305;4;300;110.2;70.9;189.2;3.693;19.8;21;28/11/2014;BLANCO;NEGRO;ROJO;AZUL;
Lexus ;LS400 ;6375;40.375;Passenger;54.005;4;290;112.2;72;196.7;3.89;22.5;22;29/03/2014;BLANCO;NEGRO;ROJO;AZUL;
Lexus ;LX470 ;9126;0.0;Car;60.105;4.7;230;112.2;76.4;192.5;5.401;25.4;15;30/10/2014;BLANCO;NEGRO;ROJO;AZUL;
Lexus ;RX300 ;51238;0.0;Car;34.605;3;220;103;71.5;180.1;3.9;17.2;21;01/04/2014;BLANCO;NEGRO;ROJO;AZUL;
Lincoln ;Continental ;13798;20.525;Passenger;39.08;4.6;275;109;73.6;208.5;3.868;20;22;08/03/2014;BLANCO;NEGRO;ROJO;AZUL;
Lincoln ;Town car ;48911;21.725;Passenger;43.33;4.6;215;117.7;78.2;215.3;4.121;19;21;06/04/2014;BLANCO;NEGRO;ROJO;AZUL;
Lincoln ;Navigator ;22925;0.0;Car;42.66;5.4;300;119;79.9;204.8;5.393;30;15;23/12/2014;BLANCO;NEGRO;ROJO;AZUL;
Mitsubishi ;Mirage ;26232;8.325;Passenger;13.987;1.8;113;98.4;66.5;173.6;2.25;13.2;30;23/04/2014;BLANCO;NEGRO;ROJO;AZUL;
Mitsubishi ;Eclipse ;42541;10.395;Passenger;19.047;2.4;154;100.8;68.9;175.4;2.91;15.9;24;24/11/2014;BLANCO;NEGRO;ROJO;AZUL;
Mitsubishi ;Galant ;55616;10.595;Passenger;17.357;2.4;145;103.7;68.5;187.8;2.945;16.3;25;29/01/2014;BLANCO;NEGRO;ROJO;AZUL;
Mitsubishi ;Diamante ;5711;16.575;Passenger;24.997;3.5;210;107.1;70.3;194.1;3.443;19;22;28/08/2014;BLANCO;NEGRO;ROJO;AZUL;
Mitsubishi ;3000GT ;11;20.94;Passenger;25.45;3;161;97.2;72.4;180.3;3.131;19.8;21;29/06/2014;BLANCO;NEGRO;ROJO;AZUL;
Mitsubishi ;Montero ;11337;19.125;Car;31.807;3.5;200;107.3;69.9;186.6;4.52;24.3;18;17/01/2014;BLANCO;NEGRO;ROJO;AZUL;
Mitsubishi ;Montero Sport ;39348;13.88;Car;22.527;3;173;107.3;66.7;178.3;3.51;19.5;20;18/05/2014;BLANCO;NEGRO;ROJO;AZUL;
Mercury ;Mystique ;14351;8.8;Passenger;16.24;2;125;106.5;69.1;184.8;2.769;15;28;19/12/2014;BLANCO;NEGRO;ROJO;AZUL;
Mercury ;Cougar ;26529;13.89;Passenger;16.54;2;125;106.4;69.6;185;2.892;16;30;23/02/2014;BLANCO;NEGRO;ROJO;AZUL;
Mercury ;Sable ;67956;11.03;Passenger;19.035;3;153;108.5;73;199.7;3.379;16;24;22/09/2014;BLANCO;NEGRO;ROJO;AZUL;
Mercury ;Grand Marquis ;81174;14.875;Passenger;22.605;4.6;200;114.7;78.2;212;3.958;19;21;24/07/2014;BLANCO;NEGRO;ROJO;AZUL;
Mercury ;Mountaineer ;27609;20.43;Car;27.56;4;210;111.6;70.2;190.1;3.876;21;18;13/02/2008;BLANCO;NEGRO;ROJO;AZUL;
Mercury ;Villager ;2038;14.795;Car;22.51;3.3;170;112.2;74.9;194.7;3.944;20;21;20/10/2009;BLANCO;NEGRO;ROJO;AZUL;
Mercedes-Benz;C-Class ;18392;26.05;Passenger;31.75;2.3;185;105.9;67.7;177.4;3.25;16.4;26;24/04/2015;BLANCO;NEGRO;ROJO;AZUL;
Mercedes-Benz;E-Class ;27602;41.45;Passenger;49.9;3.2;221;111.5;70.8;189.4;3.823;21.1;25;07/12/2015;BLANCO;NEGRO;ROJO;AZUL;
Mercedes-Benz;S-Class ;16774;50.375;Passenger;69.7;4.3;275;121.5;73.1;203.1;4.133;23.2;21;13/06/2015;BLANCO;NEGRO;ROJO;AZUL;
Mercedes-Benz;SL-Class ;3311;58.6;Passenger;82.6;5;302;99;71.3;177.1;4.125;21.1;20;17/03/2015;BLANCO;NEGRO;ROJO;AZUL;
Mercedes-Benz;SLK ;7998;0.0;Passenger;38.9;2.3;190;94.5;67.5;157.9;3.055;15.9;26;16/01/2015;BLANCO;NEGRO;ROJO;AZUL;
Mercedes-Benz;SLK230 ;1526;0.0;Passenger;41;2.3;185;94.5;67.5;157.3;2.975;14;27;08/06/2015;BLANCO;NEGRO;ROJO;AZUL;
Mercedes-Benz;CLK Coupe ;11592;0.0;Passenger;41.6;3.2;215;105.9;67.8;180.3;3.213;16.4;26;07/08/2015;BLANCO;NEGRO;ROJO;AZUL;
Mercedes-Benz;CL500 ;954;0.0;Passenger;85.5;5;302;113.6;73.1;196.6;4.115;23.2;20;04/11/2015;BLANCO;NEGRO;ROJO;AZUL;
Mercedes-Benz;M-Class ;28976;0.0;Car;35.3;3.2;215;111;72.2;180.6;4.387;19;20;02/10/2015;BLANCO;NEGRO;ROJO;AZUL;
Nissan ;Sentra ;42643;8.45;Passenger;13.499;1.8;126;99.8;67.3;177.5;2.593;13.2;30;31/08/2015;BLANCO;NEGRO;ROJO;AZUL;
Nissan ;Altima ;88094;11.295;Passenger;20.39;2.4;155;103.1;69.1;183.5;3.012;15.9;25;08/02/2015;BLANCO;NEGRO;ROJO;AZUL;
Nissan ;Maxima ;79853;15.125;Passenger;26.249;3;222;108.3;70.3;190.5;3.294;18.5;25;05/06/2015;BLANCO;NEGRO;ROJO;AZUL;
Nissan ;Quest ;27308;15.38;Car;26.399;3.3;170;112.2;74.9;194.8;3.991;20;21;03/07/2015;BLANCO;NEGRO;ROJO;AZUL;
Nissan ;Pathfinder ;42574;17.81;Car;29.299;3.3;170;106.3;71.7;182.6;3.947;21;19;25/09/2015;BLANCO;NEGRO;ROJO;AZUL;
Nissan ;Xterra ;54158;0.0;Car;22.799;3.3;170;104.3;70.4;178;3.821;19.4;18;24/01/2015;BLANCO;NEGRO;ROJO;AZUL;
Nissan ;Frontier ;65005;0.0;Car;17.89;3.3;170;116.1;66.5;196.1;3.217;19.4;18;27/08/2015;BLANCO;NEGRO;ROJO;AZUL;
Oldsmobile ;Cutlass ;1112;11.24;Passenger;18.145;3.1;150;107;69.4;192;3.102;15.2;25;31/05/2015;BLANCO;NEGRO;ROJO;AZUL;
Oldsmobile ;Intrigue ;38554;0.0;Passenger;24.15;3.5;215;109;73.6;195.9;3.455;18;0;04/01/2015;BLANCO;NEGRO;ROJO;AZUL;
Oldsmobile ;Alero ;80255;0.0;Passenger;18.27;2.4;150;107;70.1;186.7;2.958;15;27;20/10/2009;BLANCO;NEGRO;ROJO;AZUL;
Oldsmobile ;Aurora ;1469;19.89;Passenger;36.229;4;250;113.8;74.4;205.4;3.967;18.5;22;18/02/2015;BLANCO;NEGRO;ROJO;AZUL;
Oldsmobile ;Bravada ;20017;19.925;Car;31.598;4.3;190;107;67.8;181.2;4.068;17.5;19;21/09/2015;BLANCO;NEGRO;ROJO;AZUL;
Oldsmobile ;Silhouette ;24361;15.24;Car;25.345;3.4;185;120;72.2;201.4;3.948;25;22;25/06/2015;BLANCO;NEGRO;ROJO;AZUL;
Plymouth ;Neon ;32734;7.75;Passenger;12.64;2;132;105;74.4;174.4;2.559;12.5;29;26/04/2015;BLANCO;NEGRO;ROJO;AZUL;
Plymouth ;Breeze ;524;9.8;Passenger;16.08;2;132;108;71;186.3;2.942;16;27;14/11/2015;BLANCO;NEGRO;ROJO;AZUL;
Plymouth ;Voyager ;24155;12.025;Car;18.85;2.4;150;113.3;76.8;186.3;3.528;20;24;24/04/2015;BLANCO;NEGRO;ROJO;AZUL;
Plymouth ;Prowler ;1872;0.0;Passenger;43;3.5;253;113.3;76.3;165.4;2.85;12;21;27/06/2014;BLANCO;NEGRO;ROJO;AZUL;
Pontiac ;Sunfire ;51645;13.79;Passenger;21.61;2.4;150;104.1;68.4;181.9;2.906;15;27;25/01/2014;BLANCO;NEGRO;ROJO;AZUL;
Pontiac ;Grand Am ;131097;10.29;Passenger;19.72;3.4;175;107;70.4;186.3;3.091;15.2;25;26/11/2014;BLANCO;NEGRO;ROJO;AZUL;
Pontiac ;Firebird ;19911;17.805;Passenger;25.31;3.8;200;101.1;74.5;193.4;3.492;16.8;25;16/06/2014;BLANCO;NEGRO;ROJO;AZUL;
Pontiac ;Grand Prix ;92364;14.01;Passenger;21.665;3.8;195;110.5;72.7;196.5;3.396;18;25;15/10/2014;BLANCO;NEGRO;ROJO;AZUL;
Pontiac ;Bonneville ;35945;13.225;Passenger;23.755;3.8;205;112.2;72.6;202.5;3.59;17.5;24;18/05/2015;BLANCO;NEGRO;ROJO;AZUL;
Pontiac ;Montana ;39572;0.0;Car;25.635;3.4;185;120;72.7;201.3;3.942;25;23;22/07/2014;BLANCO;NEGRO;ROJO;AZUL;
Porsche ;Boxter ;8982;41.25;Passenger;41.43;2.7;217;95.2;70.1;171;2.778;17;22;19/02/2014;BLANCO;NEGRO;ROJO;AZUL;
Porsche ;Carrera Coupe ;128;60.625;Passenger;71.02;3.4;300;92.6;69.5;174.5;3.032;17;21;21/12/2014;BLANCO;NEGRO;ROJO;AZUL;
Porsche ;Carrera Cabriolet;1866;67.55;Passenger;74.97;3.4;300;92.6;69.5;174.5;3.075;17;23;07/11/2015;BLANCO;NEGRO;ROJO;AZUL;
Saab ;5-Sep;9191;0.0;Passenger;33.12;2.3;170;106.4;70.6;189.2;3.28;18.5;23;11/09/2014;BLANCO;NEGRO;ROJO;AZUL;
Saab ;3-Sep;12115;0.0;Passenger;26.1;2;185;102.6;67.4;182.2;2.99;16.9;23;06/12/2015;BLANCO;NEGRO;ROJO;AZUL;
Saturn ;SL ;8062;9.2;Passenger;10.685;1.9;100;102.4;66.4;176.9;2.332;12.1;33;16/08/2014;BLANCO;NEGRO;ROJO;AZUL;
Saturn ;SC ;24546;10.59;Passenger;12.535;1.9;100;102.4;66.4;180;2.367;12.1;33;16/03/2015;BLANCO;NEGRO;ROJO;AZUL;
Saturn ;SW ;5223;10.79;Passenger;14.29;1.9;124;102.4;66.4;176.9;2.452;12.1;31;15/01/2015;BLANCO;NEGRO;ROJO;AZUL;
Saturn ;LW ;8472;0.0;Passenger;18.835;2.2;137;106.5;69;190.4;3.075;13.1;27;08/05/2015;BLANCO;NEGRO;ROJO;AZUL;
Saturn ;LS ;49989;0.0;Passenger;15.01;2.2;137;106.5;69;190.4;2.91;13.1;28;12/04/2014;BLANCO;NEGRO;ROJO;AZUL;
Subaru ;Outback ;47107;0.0;Passenger;22.695;2.5;165;103.5;67.5;185.8;3.415;16.9;25;07/07/2015;BLANCO;NEGRO;ROJO;AZUL;
Subaru ;Forester ;33028;0.0;Car;20.095;2.5;165;99.4;68.3;175.2;3.125;15.9;24;09/10/2014;BLANCO;NEGRO;ROJO;AZUL;
Toyota ;Corolla ;142535;10.025;Passenger;13.108;1.8;120;97;66.7;174;2.42;13.2;33;04/11/2015;BLANCO;NEGRO;ROJO;AZUL;
Toyota ;Camry ;247994;13.245;Passenger;17.518;2.2;133;105.2;70.1;188.5;2.998;18.5;27;02/10/2015;BLANCO;NEGRO;ROJO;AZUL;
Toyota ;Avalon ;63849;18.14;Passenger;25.545;3;210;107.1;71.7;191.9;3.417;18.5;26;31/08/2015;BLANCO;NEGRO;ROJO;AZUL;
Toyota ;Celica ;33269;15.445;Passenger;16.875;1.8;140;102.4;68.3;170.5;2.425;14.5;31;29/12/2014;BLANCO;NEGRO;ROJO;AZUL;
Toyota ;Tacoma ;84087;9.575;Car;11.528;2.4;142;103.3;66.5;178.7;2.58;15.1;23;08/01/2015;BLANCO;NEGRO;ROJO;AZUL;
Toyota ;Sienna ;65119;0.0;Car;22.368;3;194;114.2;73.4;193.5;3.759;20.9;22;10/05/2014;BLANCO;NEGRO;ROJO;AZUL;
Toyota ;RAV4 ;25106;13.325;Car;16.888;2;127;94.9;66.7;163.8;2.668;15.3;27;05/06/2015;BLANCO;NEGRO;ROJO;AZUL;
Toyota ;4Runner ;68411;19.425;Car;22.288;2.7;150;105.3;66.5;183.3;3.44;18.5;23;03/07/2015;BLANCO;NEGRO;ROJO;AZUL;
Toyota ;Land Cruiser ;9835;34.08;Car;51.728;4.7;230;112.2;76.4;192.5;5.115;25.4;15;25/09/2015;BLANCO;NEGRO;ROJO;AZUL;
Volkswagen ;Golf ;9761;11.425;Passenger;14.9;2;115;98.9;68.3;163.3;2.767;14.5;26;24/01/2015;BLANCO;NEGRO;ROJO;AZUL;
Volkswagen ;Jetta ;83721;13.24;Passenger;16.7;2;115;98.9;68.3;172.3;2.853;14.5;26;27/08/2015;BLANCO;NEGRO;ROJO;AZUL;
Volkswagen ;Passat ;51102;16.725;Passenger;21.2;1.8;150;106.4;68.5;184.1;3.043;16.4;27;30/10/2014;BLANCO;NEGRO;ROJO;AZUL;
Volkswagen ;Cabrio ;9569;16.575;Passenger;19.99;2;115;97.4;66.7;160.4;3.079;13.7;26;31/05/2015;BLANCO;NEGRO;ROJO;AZUL;
Volkswagen ;GTI ;5596;13.76;Passenger;17.5;2;115;98.9;68.3;163.3;2.762;14.6;26;04/01/2015;BLANCO;NEGRO;ROJO;AZUL;
Volkswagen ;Beetle ;49463;0.0;Passenger;15.9;2;115;98.9;67.9;161.1;2.769;14.5;26;20/10/2015;BLANCO;NEGRO;ROJO;AZUL;
Volvo ;S40 ;16957;0.0;Passenger;23.4;1.9;160;100.5;67.6;176.6;2.998;15.8;25;18/02/2015;BLANCO;NEGRO;ROJO;AZUL;
Volvo ;V40 ;3545;0.0;Passenger;24.4;1.9;160;100.5;67.6;176.6;3.042;15.8;25;21/09/2015;BLANCO;NEGRO;ROJO;AZUL;
Volvo ;S70 ;15245;0.0;Passenger;27.5;2.4;168;104.9;69.3;185.9;3.208;17.9;25;24/11/2014;BLANCO;NEGRO;ROJO;AZUL;
Volvo ;V70 ;17531;0.0;Passenger;28.8;2.4;168;104.9;69.3;186.2;3.259;17.9;25;25/06/2015;BLANCO;NEGRO;ROJO;AZUL;
Volvo ;C70 ;3493;0.0;Passenger;45.5;2.3;236;104.9;71.5;185.7;3.601;18.5;23;26/04/2015;BLANCO;NEGRO;ROJO;AZUL;
Volvo ;S80 ;18969;0.0;Passenger;36;2.9;201;109.9;72.1;189.8;3.6;21.1;24;14/11/2015;BLANCO;NEGRO;ROJO;AZUL;
1 Manufacturer Model Sales in thousands 4-year resale value Vehicle type Price in thousands Engine size Horsepower Wheelbase Width Length Curb weight Fuel capacity Fuel efficiency Latest Launch Color1 Color2 Color3 Color4 Color5
2 Acura Integra 16919 16.36 Passenger 21.5 1.8 140 101.2 67.3 172.4 2.639 13.2 28 02/02/2014 BLANCO NEGRO ROJO AZUL
3 Acura TL 39384 19.875 Passenger 28.4 3.2 225 108.1 70.3 192.9 3.517 17.2 25 06/03/2015 BLANCO NEGRO ROJO AZUL
4 Acura CL 14114 18.225 Passenger 29.295 3.2 225 106.9 70.6 192 3.47 17.2 26 01/04/2014 BLANCO NEGRO ROJO AZUL
5 Acura RL 8588 29.725 Passenger 42 3.5 210 114.6 71.4 196.6 3.85 18 22 03/10/2015 BLANCO NEGRO ROJO AZUL
6 Audi A4 20397 22.255 Passenger 23.99 1.8 150 102.6 68.2 178 2.998 16.4 27 10/08/2015 BLANCO NEGRO ROJO AZUL
7 Audi A6 1878 23.555 Passenger 33.95 2.8 200 108.7 76.1 192 3.561 18.5 22 08/09/2015 BLANCO NEGRO ROJO AZUL
8 Audi A8 138 39 Passenger 62 4.2 310 113 74 198.2 3.902 23.7 21 27/02/2014 BLANCO GRIS ROJO AZUL
9 BMW 323i 19747 0.0 Passenger 26.99 2.5 170 107.3 68.4 176 3.179 16.6 26 28/06/2015 BLANCO GRIS ROJO AZUL
10 BMW 328i 9231 28.675 Passenger 33.4 2.8 193 107.3 68.5 176 3.197 16.6 24 29/01/2014 BLANCO GRIS ROJO AZUL
11 BMW 528i 17527 36.125 Passenger 38.9 2.8 193 111.4 70.9 188 3.472 18.5 25 04/04/2015 BLANCO GRIS ROJO AZUL
12 Buick Century 91561 12.475 Passenger 21.975 3.1 175 109 72.7 194.6 3.368 17.5 25 11/02/2015 BLANCO GRIS ROJO AZUL
13 Buick Regal 3935 13.74 Passenger 25.3 3.8 240 109 72.7 196.2 3.543 17.5 23 09/03/2015 BLANCO GRIS ROJO AZUL
14 Buick Park Avenue 27851 20.19 Passenger 31.965 3.8 205 113.8 74.7 206.8 3.778 18.5 24 23/03/2014 BLANCO GRIS ROJO AZUL
15 Buick LeSabre 83257 13.36 Passenger 27.885 3.8 205 112.2 73.5 200 3.591 17.5 25 23/07/2015 BLANCO GRIS ROJO AZUL
16 Cadillac DeVille 63729 22.525 Passenger 39.895 4.6 275 115.3 74.5 207.2 3.978 18.5 22 23/02/2014 BLANCO GRIS ROJO AZUL GRIS
17 Cadillac Seville 15943 27.1 Passenger 44.475 4.6 275 112.2 75 201 0 18.5 22 29/04/2015 BLANCO GRIS ROJO AZUL GRIS
18 Cadillac Eldorado 6536 25.725 Passenger 39.665 4.6 275 108 75.5 200.6 3.843 19 22 27/11/2015 BLANCO NEGRO GRIS AZUL GRIS
19 Cadillac Catera 11185 18.225 Passenger 31.01 3 200 107.4 70.3 194.8 3.77 18 22 28/09/2015 BLANCO NEGRO GRIS AZUL GRIS
20 Cadillac Escalade 14785 0.0 Car 46.225 5.7 255 117.5 77 201.2 5.572 30 15 17/04/2014 BLANCO NEGRO GRIS AZUL GRIS
21 Chevrolet Cavalier 145519 9.25 Passenger 13.26 2.2 115 104.1 67.9 180.9 2.676 14.3 27 17/08/2015 BLANCO NEGRO GRIS AZUL GRIS
22 Chevrolet Malibu 135126 11.225 Passenger 16.535 3.1 170 107 69.4 190.4 3.051 15 25 19/03/2014 BLANCO AMARILLO GRIS AZUL GRIS
23 Chevrolet Lumina 24629 10.31 Passenger 18.89 3.1 175 107.5 72.5 200.9 3.33 16.6 25 24/05/2015 BLANCO AMARILLO GRIS AZUL GRIS
24 Chevrolet Monte Carlo 42593 11.525 Passenger 19.39 3.4 180 110.5 72.7 197.9 3.34 17 27 22/12/2015 BLANCO AMARILLO GRIS AZUL GRIS
25 Chevrolet Camaro 26402 13.025 Passenger 24.34 3.8 200 101.1 74.1 193.2 3.5 16.8 25 23/10/2015 BLANCO AMARILLO GRIS AZUL GRIS
26 Chevrolet Corvette 17947 36.225 Passenger 45.705 5.7 345 104.5 73.6 179.7 3.21 19.1 22 05/12/2014 BLANCO AMARILLO GRIS AZUL AMARILLO
27 Chevrolet Prizm 32299 9.125 Passenger 13.96 1.8 120 97.1 66.7 174.3 2.398 13.2 33 09/11/2015 BLANCO AMARILLO GRIS AZUL AMARILLO
28 Chevrolet Metro 21855 5.16 Passenger 9.235 1 55 93.1 62.6 149.4 1.895 10.3 45 13/04/2014 BLANCO AMARILLO ROJO AZUL AMARILLO
29 Chevrolet Impala 107995 0.0 Passenger 18.89 3.4 180 110.5 73 200 3.389 17 27 18/06/2015 BLANCO AMARILLO ROJO AZUL AMARILLO
30 Chrysler Sebring Coupe 7854 12.36 Passenger 19.84 2.5 163 103.7 69.7 190.9 2.967 15.9 24 16/01/2014 BLANCO AMARILLO ROJO AZUL AMARILLO
31 Chrysler Sebring Conv. 32775 14.18 Passenger 24.495 2.5 168 106 69.2 193 3.332 16 24 17/11/2015 BLANCO AMARILLO ROJO GRIS AMARILLO
32 Chrysler Concorde 31148 13.725 Passenger 22.245 2.7 200 113 74.4 209.1 3.452 17 26 06/06/2014 BLANCO AMARILLO ROJO GRIS AMARILLO
33 Chrysler Cirrus 32306 12.64 Passenger 16.48 2 132 108 71 186 2.911 16 27 10/06/2015 BLANCO AMARILLO ROJO GRIS AMARILLO
34 Chrysler LHS 13462 17.325 Passenger 28.34 3.5 253 113 74.4 207.7 3.564 17 23 05/08/2014 BLANCO AMARILLO ROJO GRIS AMARILLO
35 Chrysler 300M 30696 0.0 Passenger 29.185 3.5 253 113 74.4 197.8 3.567 17 23 02/10/2014 BLANCO NEGRO ROJO GRIS AMARILLO
36 Dodge Neon 76034 7.75 Passenger 12.64 2 132 105 74.4 174.4 2.567 12.5 29 12/12/2015 BLANCO NEGRO ROJO GRIS AMARILLO
37 Dodge Avenger 4734 12.545 Passenger 19.045 2.5 163 103.7 69.1 190.2 2.879 15.9 24 07/01/2014 BLANCO NEGRO ROJO GRIS AMARILLO
38 Dodge Stratus 71186 10.185 Passenger 20.23 2.5 168 108 71 186 3.058 16 24 31/10/2015 BLANCO NEGRO ROJO GRIS
39 Dodge Intrepid 88028 12.275 Passenger 22.505 2.7 202 113 74.7 203.7 3.489 17 0 06/02/2014 BLANCO NEGRO AMARILLO GRIS
40 Dodge Viper 916 58.47 Passenger 69.725 8 450 96.2 75.7 176.7 3.375 19 16 08/07/2015 BLANCO NEGRO AMARILLO AZUL
41 Dodge Ram Pickup 227061 15.06 Car 19.46 5.2 230 138.7 79.3 224.2 4.47 26 17 03/06/2014 BLANCO NEGRO AMARILLO AZUL
42 Dodge Ram Wagon 16767 15.51 Car 21.315 3.9 175 109.6 78.8 192.6 4.245 32 15 01/06/2014 BLANCO NEGRO AMARILLO AZUL
43 Dodge Ram Van 31038 13.425 Car 18.575 3.9 175 127.2 78.8 208.5 4.298 32 16 26/07/2014 BLANCO NEGRO AMARILLO AZUL
44 Dodge Dakota 111313 11.26 Car 16.98 2.5 120 131 71.5 215 3.557 22 19 25/11/2015 BLANCO NEGRO AMARILLO AZUL
45 Dodge Durango 101323 0.0 Car 26.31 5.2 230 115.7 71.7 193.5 4.394 25 17 27/06/2014 BLANCO NEGRO AMARILLO AZUL
46 Dodge Caravan 181749 12.025 Car 19.565 2.4 150 113.3 76.8 186.3 3.533 20 24 09/01/2015 BLANCO NEGRO AMARILLO AZUL
47 Ford Escort 70227 7.425 Passenger 12.07 2 110 98.4 67 174.7 2.468 12.7 30 31/03/2014 BLANCO NEGRO AMARILLO AZUL
48 Ford Mustang 113369 12.76 Passenger 21.56 3.8 190 101.3 73.1 183.2 3.203 15.7 24 31/01/2014 BLANCO NEGRO AMARILLO AZUL
49 Ford Contour 35068 8.835 Passenger 17.035 2.5 170 106.5 69.1 184.6 2.769 15 25 20/08/2014 BLANCO NEGRO AMARILLO AZUL
50 Ford Taurus 245815 10.055 Passenger 17.885 3 155 108.5 73 197.6 3.368 16 24 20/12/2015 BLANCO NEGRO AMARILLO AZUL
51 Ford Focus 17567 0.0 Passenger 12.315 2 107 103 66.9 174.8 2.564 13.2 30 22/07/2014 BLANCO NEGRO AMARILLO AZUL
52 Ford Crown Victoria 63403 14.21 Passenger 22.195 4.6 200 114.7 78.2 212 3.908 19 21 26/09/2015 BLANCO NEGRO ROJO AZUL
53 Ford Explorer 276747 16.64 Car 31.93 4 210 111.6 70.2 190.7 3.876 21 19 25/04/2014 BLANCO NEGRO ROJO AMARILLO
54 Ford Windstar 155787 13.175 Car 21.41 3 150 120.7 76.6 200.9 3.761 26 21 25/02/2014 BLANCO NEGRO ROJO AMARILLO
55 Ford Expedition 125338 23.575 Car 36.135 4.6 240 119 78.7 204.6 4.808 26 16 14/09/2014 BLANCO NEGRO ROJO AMARILLO
56 Ford Ranger 22065 7.85 Car 12.05 2.5 119 117.5 69.4 200.7 3.086 20 23 14/01/2014 BLANCO NEGRO ROJO AMARILLO
57 Ford F-Series 540561 15.075 Car 26.935 4.6 220 138.5 79.1 224.5 4.241 25.1 18 16/08/2014 BLANCO NEGRO ROJO AMARILLO
58 Honda Civic 199685 9.85 Passenger 12.885 1.6 106 103.2 67.1 175.1 2.339 11.9 32 21/10/2015 BLANCO NEGRO ROJO AMARILLO
59 Honda Accord 230902 13.21 Passenger 15.35 2.3 135 106.9 70.3 188.8 2.932 17.1 27 20/05/2014 BLANCO NEGRO ROJO AMARILLO
60 Honda CR-V 73203 17.71 Car 20.55 2 146 103.2 68.9 177.6 3.219 15.3 24 21/03/2014 BLANCO NEGRO ROJO AMARILLO
61 Honda Passport 12855 17.525 Car 26.6 3.2 205 106.4 70.4 178.2 3.857 21.1 19 10/09/2014 BLANCO NEGRO ROJO AMARILLO
62 Honda Odyssey 76029 19.49 Car 26 3.5 210 118.1 75.6 201.2 4.288 20 23 02/08/2014 BLANCO NEGRO ROJO AMARILLO
63 Hyundai Accent 41184 5.86 Passenger 9.699 1.5 92 96.1 65.7 166.7 2.24 11.9 31 09/10/2014 BLANCO NEGRO ROJO AMARILLO
64 Hyundai Elantra 66692 7.825 Passenger 11.799 2 140 100.4 66.9 174 2.626 14.5 27 15/11/2015 BLANCO NEGRO ROJO AMARILLO
65 Hyundai Sonata 2945 8.91 Passenger 14.999 2.4 148 106.3 71.6 185.4 3.072 17.2 25 14/06/2014 BLANCO NEGRO ROJO AMARILLO
66 Infiniti I30 23713 19.69 Passenger 29.465 3 227 108.3 70.2 193.7 3.342 18.5 25 15/04/2014 BLANCO NEGRO ROJO AZUL
67 Jaguar S-Type 15467 0.0 Passenger 42.8 3 240 114.5 71.6 191.3 3.65 18.4 21 11/03/2014 BLANCO NEGRO ROJO AZUL
68 Jeep Wrangler 55557 13.475 Car 14.46 2.5 120 93.4 66.7 152 3.045 19 17 03/04/2014 BLANCO NEGRO ROJO AZUL
69 Jeep Cherokee 80556 13.775 Car 21.62 4 190 101.4 69.4 167.5 3.194 20 20 10/05/2014 BLANCO NEGRO ROJO AZUL
70 Jeep Grand Cherokee 15704 18.81 Car 26.895 4 195 105.9 72.3 181.5 3.88 20.5 19 12/10/2015 BLANCO NEGRO ROJO AZUL
71 Lexus ES300 24072 26.975 Passenger 31.505 3 210 105.1 70.5 190.2 3.373 18.5 23 07/09/2014 BLANCO NEGRO ROJO AZUL
72 Lexus GS300 12698 32.075 Passenger 37.805 3 225 110.2 70.9 189.2 3.638 19.8 23 05/10/2014 BLANCO NEGRO ROJO AZUL
73 Lexus GS400 3334 0.0 Passenger 46.305 4 300 110.2 70.9 189.2 3.693 19.8 21 28/11/2014 BLANCO NEGRO ROJO AZUL
74 Lexus LS400 6375 40.375 Passenger 54.005 4 290 112.2 72 196.7 3.89 22.5 22 29/03/2014 BLANCO NEGRO ROJO AZUL
75 Lexus LX470 9126 0.0 Car 60.105 4.7 230 112.2 76.4 192.5 5.401 25.4 15 30/10/2014 BLANCO NEGRO ROJO AZUL
76 Lexus RX300 51238 0.0 Car 34.605 3 220 103 71.5 180.1 3.9 17.2 21 01/04/2014 BLANCO NEGRO ROJO AZUL
77 Lincoln Continental 13798 20.525 Passenger 39.08 4.6 275 109 73.6 208.5 3.868 20 22 08/03/2014 BLANCO NEGRO ROJO AZUL
78 Lincoln Town car 48911 21.725 Passenger 43.33 4.6 215 117.7 78.2 215.3 4.121 19 21 06/04/2014 BLANCO NEGRO ROJO AZUL
79 Lincoln Navigator 22925 0.0 Car 42.66 5.4 300 119 79.9 204.8 5.393 30 15 23/12/2014 BLANCO NEGRO ROJO AZUL
80 Mitsubishi Mirage 26232 8.325 Passenger 13.987 1.8 113 98.4 66.5 173.6 2.25 13.2 30 23/04/2014 BLANCO NEGRO ROJO AZUL
81 Mitsubishi Eclipse 42541 10.395 Passenger 19.047 2.4 154 100.8 68.9 175.4 2.91 15.9 24 24/11/2014 BLANCO NEGRO ROJO AZUL
82 Mitsubishi Galant 55616 10.595 Passenger 17.357 2.4 145 103.7 68.5 187.8 2.945 16.3 25 29/01/2014 BLANCO NEGRO ROJO AZUL
83 Mitsubishi Diamante 5711 16.575 Passenger 24.997 3.5 210 107.1 70.3 194.1 3.443 19 22 28/08/2014 BLANCO NEGRO ROJO AZUL
84 Mitsubishi 3000GT 11 20.94 Passenger 25.45 3 161 97.2 72.4 180.3 3.131 19.8 21 29/06/2014 BLANCO NEGRO ROJO AZUL
85 Mitsubishi Montero 11337 19.125 Car 31.807 3.5 200 107.3 69.9 186.6 4.52 24.3 18 17/01/2014 BLANCO NEGRO ROJO AZUL
86 Mitsubishi Montero Sport 39348 13.88 Car 22.527 3 173 107.3 66.7 178.3 3.51 19.5 20 18/05/2014 BLANCO NEGRO ROJO AZUL
87 Mercury Mystique 14351 8.8 Passenger 16.24 2 125 106.5 69.1 184.8 2.769 15 28 19/12/2014 BLANCO NEGRO ROJO AZUL
88 Mercury Cougar 26529 13.89 Passenger 16.54 2 125 106.4 69.6 185 2.892 16 30 23/02/2014 BLANCO NEGRO ROJO AZUL
89 Mercury Sable 67956 11.03 Passenger 19.035 3 153 108.5 73 199.7 3.379 16 24 22/09/2014 BLANCO NEGRO ROJO AZUL
90 Mercury Grand Marquis 81174 14.875 Passenger 22.605 4.6 200 114.7 78.2 212 3.958 19 21 24/07/2014 BLANCO NEGRO ROJO AZUL
91 Mercury Mountaineer 27609 20.43 Car 27.56 4 210 111.6 70.2 190.1 3.876 21 18 13/02/2008 BLANCO NEGRO ROJO AZUL
92 Mercury Villager 2038 14.795 Car 22.51 3.3 170 112.2 74.9 194.7 3.944 20 21 20/10/2009 BLANCO NEGRO ROJO AZUL
93 Mercedes-Benz C-Class 18392 26.05 Passenger 31.75 2.3 185 105.9 67.7 177.4 3.25 16.4 26 24/04/2015 BLANCO NEGRO ROJO AZUL
94 Mercedes-Benz E-Class 27602 41.45 Passenger 49.9 3.2 221 111.5 70.8 189.4 3.823 21.1 25 07/12/2015 BLANCO NEGRO ROJO AZUL
95 Mercedes-Benz S-Class 16774 50.375 Passenger 69.7 4.3 275 121.5 73.1 203.1 4.133 23.2 21 13/06/2015 BLANCO NEGRO ROJO AZUL
96 Mercedes-Benz SL-Class 3311 58.6 Passenger 82.6 5 302 99 71.3 177.1 4.125 21.1 20 17/03/2015 BLANCO NEGRO ROJO AZUL
97 Mercedes-Benz SLK 7998 0.0 Passenger 38.9 2.3 190 94.5 67.5 157.9 3.055 15.9 26 16/01/2015 BLANCO NEGRO ROJO AZUL
98 Mercedes-Benz SLK230 1526 0.0 Passenger 41 2.3 185 94.5 67.5 157.3 2.975 14 27 08/06/2015 BLANCO NEGRO ROJO AZUL
99 Mercedes-Benz CLK Coupe 11592 0.0 Passenger 41.6 3.2 215 105.9 67.8 180.3 3.213 16.4 26 07/08/2015 BLANCO NEGRO ROJO AZUL
100 Mercedes-Benz CL500 954 0.0 Passenger 85.5 5 302 113.6 73.1 196.6 4.115 23.2 20 04/11/2015 BLANCO NEGRO ROJO AZUL
101 Mercedes-Benz M-Class 28976 0.0 Car 35.3 3.2 215 111 72.2 180.6 4.387 19 20 02/10/2015 BLANCO NEGRO ROJO AZUL
102 Nissan Sentra 42643 8.45 Passenger 13.499 1.8 126 99.8 67.3 177.5 2.593 13.2 30 31/08/2015 BLANCO NEGRO ROJO AZUL
103 Nissan Altima 88094 11.295 Passenger 20.39 2.4 155 103.1 69.1 183.5 3.012 15.9 25 08/02/2015 BLANCO NEGRO ROJO AZUL
104 Nissan Maxima 79853 15.125 Passenger 26.249 3 222 108.3 70.3 190.5 3.294 18.5 25 05/06/2015 BLANCO NEGRO ROJO AZUL
105 Nissan Quest 27308 15.38 Car 26.399 3.3 170 112.2 74.9 194.8 3.991 20 21 03/07/2015 BLANCO NEGRO ROJO AZUL
106 Nissan Pathfinder 42574 17.81 Car 29.299 3.3 170 106.3 71.7 182.6 3.947 21 19 25/09/2015 BLANCO NEGRO ROJO AZUL
107 Nissan Xterra 54158 0.0 Car 22.799 3.3 170 104.3 70.4 178 3.821 19.4 18 24/01/2015 BLANCO NEGRO ROJO AZUL
108 Nissan Frontier 65005 0.0 Car 17.89 3.3 170 116.1 66.5 196.1 3.217 19.4 18 27/08/2015 BLANCO NEGRO ROJO AZUL
109 Oldsmobile Cutlass 1112 11.24 Passenger 18.145 3.1 150 107 69.4 192 3.102 15.2 25 31/05/2015 BLANCO NEGRO ROJO AZUL
110 Oldsmobile Intrigue 38554 0.0 Passenger 24.15 3.5 215 109 73.6 195.9 3.455 18 0 04/01/2015 BLANCO NEGRO ROJO AZUL
111 Oldsmobile Alero 80255 0.0 Passenger 18.27 2.4 150 107 70.1 186.7 2.958 15 27 20/10/2009 BLANCO NEGRO ROJO AZUL
112 Oldsmobile Aurora 1469 19.89 Passenger 36.229 4 250 113.8 74.4 205.4 3.967 18.5 22 18/02/2015 BLANCO NEGRO ROJO AZUL
113 Oldsmobile Bravada 20017 19.925 Car 31.598 4.3 190 107 67.8 181.2 4.068 17.5 19 21/09/2015 BLANCO NEGRO ROJO AZUL
114 Oldsmobile Silhouette 24361 15.24 Car 25.345 3.4 185 120 72.2 201.4 3.948 25 22 25/06/2015 BLANCO NEGRO ROJO AZUL
115 Plymouth Neon 32734 7.75 Passenger 12.64 2 132 105 74.4 174.4 2.559 12.5 29 26/04/2015 BLANCO NEGRO ROJO AZUL
116 Plymouth Breeze 524 9.8 Passenger 16.08 2 132 108 71 186.3 2.942 16 27 14/11/2015 BLANCO NEGRO ROJO AZUL
117 Plymouth Voyager 24155 12.025 Car 18.85 2.4 150 113.3 76.8 186.3 3.528 20 24 24/04/2015 BLANCO NEGRO ROJO AZUL
118 Plymouth Prowler 1872 0.0 Passenger 43 3.5 253 113.3 76.3 165.4 2.85 12 21 27/06/2014 BLANCO NEGRO ROJO AZUL
119 Pontiac Sunfire 51645 13.79 Passenger 21.61 2.4 150 104.1 68.4 181.9 2.906 15 27 25/01/2014 BLANCO NEGRO ROJO AZUL
120 Pontiac Grand Am 131097 10.29 Passenger 19.72 3.4 175 107 70.4 186.3 3.091 15.2 25 26/11/2014 BLANCO NEGRO ROJO AZUL
121 Pontiac Firebird 19911 17.805 Passenger 25.31 3.8 200 101.1 74.5 193.4 3.492 16.8 25 16/06/2014 BLANCO NEGRO ROJO AZUL
122 Pontiac Grand Prix 92364 14.01 Passenger 21.665 3.8 195 110.5 72.7 196.5 3.396 18 25 15/10/2014 BLANCO NEGRO ROJO AZUL
123 Pontiac Bonneville 35945 13.225 Passenger 23.755 3.8 205 112.2 72.6 202.5 3.59 17.5 24 18/05/2015 BLANCO NEGRO ROJO AZUL
124 Pontiac Montana 39572 0.0 Car 25.635 3.4 185 120 72.7 201.3 3.942 25 23 22/07/2014 BLANCO NEGRO ROJO AZUL
125 Porsche Boxter 8982 41.25 Passenger 41.43 2.7 217 95.2 70.1 171 2.778 17 22 19/02/2014 BLANCO NEGRO ROJO AZUL
126 Porsche Carrera Coupe 128 60.625 Passenger 71.02 3.4 300 92.6 69.5 174.5 3.032 17 21 21/12/2014 BLANCO NEGRO ROJO AZUL
127 Porsche Carrera Cabriolet 1866 67.55 Passenger 74.97 3.4 300 92.6 69.5 174.5 3.075 17 23 07/11/2015 BLANCO NEGRO ROJO AZUL
128 Saab 5-Sep 9191 0.0 Passenger 33.12 2.3 170 106.4 70.6 189.2 3.28 18.5 23 11/09/2014 BLANCO NEGRO ROJO AZUL
129 Saab 3-Sep 12115 0.0 Passenger 26.1 2 185 102.6 67.4 182.2 2.99 16.9 23 06/12/2015 BLANCO NEGRO ROJO AZUL
130 Saturn SL 8062 9.2 Passenger 10.685 1.9 100 102.4 66.4 176.9 2.332 12.1 33 16/08/2014 BLANCO NEGRO ROJO AZUL
131 Saturn SC 24546 10.59 Passenger 12.535 1.9 100 102.4 66.4 180 2.367 12.1 33 16/03/2015 BLANCO NEGRO ROJO AZUL
132 Saturn SW 5223 10.79 Passenger 14.29 1.9 124 102.4 66.4 176.9 2.452 12.1 31 15/01/2015 BLANCO NEGRO ROJO AZUL
133 Saturn LW 8472 0.0 Passenger 18.835 2.2 137 106.5 69 190.4 3.075 13.1 27 08/05/2015 BLANCO NEGRO ROJO AZUL
134 Saturn LS 49989 0.0 Passenger 15.01 2.2 137 106.5 69 190.4 2.91 13.1 28 12/04/2014 BLANCO NEGRO ROJO AZUL
135 Subaru Outback 47107 0.0 Passenger 22.695 2.5 165 103.5 67.5 185.8 3.415 16.9 25 07/07/2015 BLANCO NEGRO ROJO AZUL
136 Subaru Forester 33028 0.0 Car 20.095 2.5 165 99.4 68.3 175.2 3.125 15.9 24 09/10/2014 BLANCO NEGRO ROJO AZUL
137 Toyota Corolla 142535 10.025 Passenger 13.108 1.8 120 97 66.7 174 2.42 13.2 33 04/11/2015 BLANCO NEGRO ROJO AZUL
138 Toyota Camry 247994 13.245 Passenger 17.518 2.2 133 105.2 70.1 188.5 2.998 18.5 27 02/10/2015 BLANCO NEGRO ROJO AZUL
139 Toyota Avalon 63849 18.14 Passenger 25.545 3 210 107.1 71.7 191.9 3.417 18.5 26 31/08/2015 BLANCO NEGRO ROJO AZUL
140 Toyota Celica 33269 15.445 Passenger 16.875 1.8 140 102.4 68.3 170.5 2.425 14.5 31 29/12/2014 BLANCO NEGRO ROJO AZUL
141 Toyota Tacoma 84087 9.575 Car 11.528 2.4 142 103.3 66.5 178.7 2.58 15.1 23 08/01/2015 BLANCO NEGRO ROJO AZUL
142 Toyota Sienna 65119 0.0 Car 22.368 3 194 114.2 73.4 193.5 3.759 20.9 22 10/05/2014 BLANCO NEGRO ROJO AZUL
143 Toyota RAV4 25106 13.325 Car 16.888 2 127 94.9 66.7 163.8 2.668 15.3 27 05/06/2015 BLANCO NEGRO ROJO AZUL
144 Toyota 4Runner 68411 19.425 Car 22.288 2.7 150 105.3 66.5 183.3 3.44 18.5 23 03/07/2015 BLANCO NEGRO ROJO AZUL
145 Toyota Land Cruiser 9835 34.08 Car 51.728 4.7 230 112.2 76.4 192.5 5.115 25.4 15 25/09/2015 BLANCO NEGRO ROJO AZUL
146 Volkswagen Golf 9761 11.425 Passenger 14.9 2 115 98.9 68.3 163.3 2.767 14.5 26 24/01/2015 BLANCO NEGRO ROJO AZUL
147 Volkswagen Jetta 83721 13.24 Passenger 16.7 2 115 98.9 68.3 172.3 2.853 14.5 26 27/08/2015 BLANCO NEGRO ROJO AZUL
148 Volkswagen Passat 51102 16.725 Passenger 21.2 1.8 150 106.4 68.5 184.1 3.043 16.4 27 30/10/2014 BLANCO NEGRO ROJO AZUL
149 Volkswagen Cabrio 9569 16.575 Passenger 19.99 2 115 97.4 66.7 160.4 3.079 13.7 26 31/05/2015 BLANCO NEGRO ROJO AZUL
150 Volkswagen GTI 5596 13.76 Passenger 17.5 2 115 98.9 68.3 163.3 2.762 14.6 26 04/01/2015 BLANCO NEGRO ROJO AZUL
151 Volkswagen Beetle 49463 0.0 Passenger 15.9 2 115 98.9 67.9 161.1 2.769 14.5 26 20/10/2015 BLANCO NEGRO ROJO AZUL
152 Volvo S40 16957 0.0 Passenger 23.4 1.9 160 100.5 67.6 176.6 2.998 15.8 25 18/02/2015 BLANCO NEGRO ROJO AZUL
153 Volvo V40 3545 0.0 Passenger 24.4 1.9 160 100.5 67.6 176.6 3.042 15.8 25 21/09/2015 BLANCO NEGRO ROJO AZUL
154 Volvo S70 15245 0.0 Passenger 27.5 2.4 168 104.9 69.3 185.9 3.208 17.9 25 24/11/2014 BLANCO NEGRO ROJO AZUL
155 Volvo V70 17531 0.0 Passenger 28.8 2.4 168 104.9 69.3 186.2 3.259 17.9 25 25/06/2015 BLANCO NEGRO ROJO AZUL
156 Volvo C70 3493 0.0 Passenger 45.5 2.3 236 104.9 71.5 185.7 3.601 18.5 23 26/04/2015 BLANCO NEGRO ROJO AZUL
157 Volvo S80 18969 0.0 Passenger 36 2.9 201 109.9 72.1 189.8 3.6 21.1 24 14/11/2015 BLANCO NEGRO ROJO AZUL

View File

@@ -0,0 +1,179 @@
# Proyecto del Segundo Cuatrimestre Fundamentos de Programación (Curso 22/23)
## 👤 Autor: José Manuel Amador Gallardo &nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp; 🪪 UVUS: -------
El dataset consta de varias propiedades de coches (como pueden ser fabricante, modelo, color, tamaño del motor, capacidad de combustible, etc).
## 🟥 Estructura de las carpetas del proyecto
├─ **📁 src**: Contiene los diferentes archivos que forman parte del proyecto.<br>
&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;├─ **📦 fp.coches**: Paquete que contiene los tipos del proyecto.<br>
&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;├─ 📄 Coche.java<br>
&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;├─ 📄 Concesionario.java<br>
&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;└─ 📄 FactoriaCoches.java<br>
&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;├─ **📦 fp.coches.test**: Paquete que contiene las clases de test del proyecto.<br>
&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;├─ 📄 TestCoche.java<br>
&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;├─ 📄 TestConcesionario.java<br>
&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;└─ 📄 TestFactoriaCoches.java<br>
&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;├─ **📦 fp.common**: Paquete que contiene los tipos auxiliares del proyecto.<br>
&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;├─ 📄 ColorCoche.java<br>
&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;├─ 📄 Motor.java<br>
&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;└─ 📄 TipoCoche.java<br>
&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;└─ **📦 fp.utiles**: Paquete que contiene las clases de utilidad.<br>
&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;├─ 📄 Checkers.java<br>
&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;├─ 📄 Fichero.java<br>
&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;├─ 📄 Mostrar.java<br>
&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;└─ 📄 Parsers.java<br>
├─ **📁 data**: Contiene el dataset del proyecto.<br>
&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;└─ **📄 coches.csv**: Datos sobre coches de varios fabricantes.
<br>
└─ **📁 docs**: Contiene la documentación del proyecto.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;└─ **📄 README.md**
: Documentación.
## 🟥 Estructura del *dataset*
El dataset está compuesto por 20 columnas, con la siguiente descripción:
* **Manufacturer**: de tipo ``String``, representa el nombre del fabricante.
* **Model**: de tipo ``String``, representa el modelo del vehículo.
* **Sales in thousands**: de tipo ``Integer``, representa el número de ventas en miles.
* **4-year resale value**: de tipo ``Float/Double``, representa el valor de reventa a los cuatro años.
* **Vehicle type**: de tipo ``String``, representa el tipo de vehículo.
* **Price in thousands**: de tipo ``Float/Double``, representa el precio en miles del vehículo.
* **Engine size**: de tipo ``Float/Double``, representa el tamaño del motor en L.
* **Horsepower**: de tipo Integer, representa la potencia del vehículo en CV.
* **Wheelbase**: de tipo ``Float/Double``, representa la distancia entre los dos ejes de las ruedas.
* **Width**: de tipo ``Float/Double``, representa el ancho del vehículo.
* **Length**: de tipo ``Float/Double``, representa el largo del vehículo.
* **Curb weight**: de tipo ``Float/Double``, representa el peso en vacío del vehículo.
* **Fuel capacity**: de tipo ``Float/Double``, representa la capacidad de combustible del vehículo.
* **Fuel efficiency**: de tipo ``Integer``, representa la eficiencia del combustible.
* **Latest launch**: de tipo ``String``, representa el último lanzamiento del vehículo.
* **Color 1**: de tipo ``String``, representa el primer color disponible del vehículo.
* **Color 2**: de tipo ``String``, representa el segundo color disponible del vehículo.
* **Color 3**: de tipo ``String``, representa el tercer color disponible del vehículo.
* **Color 4**: de tipo ``String``, representa el cuarto color disponible del vehículo.
* **Color 5**: de tipo ``String``, representa el quinto color disponible del vehículo.
## 🟥 Tipos implementados
### 🔷 **Tipo Coche**
Tipo base con métodos básicos:
Constructor/es, Getters & Setters, toString, equals, compareTo
**PROPIEDADES**:
| Propiedad | Tipo | Descripción |
|-------------|-----------------------|----------------------------------------|
fabricante | ``String`` | consultable y modificable.
modelo | ``String`` | consultable y modificable.
potencia | ``Integer`` | consultable y modificable.
tamañoMotor | ``Float`` | consultable y modificable.
tipo | ``TipoCoche`` | consultable y modificable.
precio | ``Integer`` | consultable y modificable.
salidaMercado | ``LocalDate`` | consultable y modificable.
listaColores | ``List<ColorCoche>`` | consultable y modificable.
**CONSTRUCTORES**:
- **C1:** Un parámetro por cada propiedad.
- **C2:** Sólo recibe como parámetros el fabricante, el modelo y la lista de colores.
**RESTRICCIONES**:
- **R1:** el precio no puede ser negativo.
- **R2:** la lista de colores no puede ser ```null```.
**CRITERIO DE IGUALDAD**:
- Sirve para saber si dos objetos tipo Coche son iguales.
**CRITERIO DE ORDENACIÓN**:
- Compara el nombre del fabricante para ordenar por nombre de fabricante.
**OTRAS OPERACIONES**:
- tipoCocheParser: Convierte el tipo de vehículo para el toString (ej.) ``TipoCoche.PASSENGER`` a ``"Passenger"``.
- salidaMercadoParser: Convierte el formato ``YYYY-MM-dd`` a ``dd/MM/YYYY``.
- getFormatoCorto: Devuelve el toString en un formato más comprimido "one-line".
- toString: Formatea el tipo en un String legible.
- hashCode: Generea un hashcode.
### 🔷 **Tipo Concesionario**
Tipo contenedor de tipos Coche con métodos básicos (L58).
**PROPIEDADES**:
| Propiedad | Tipo | Descripción |
|-------------|-----------------------|----------------------------------------|
coches | ``Set<Coche>`` | consultable y modificable.
**CONSTRUCTORES**:
- **C1:** Un parámetro por cada propiedad.
- **C2:** Constructor vacío que devuelve un Set&lt;Coche&gt; vacío.
**CRITERIO DE IGUALDAD**:
- Sirve para saber si dos objetos tipo Concesionario son iguales.
**OTRAS OPERACIONES**:
- getNumeroCoches: Devuelve el número total de tipos Coche en coches.
- añadirCoche: Añade un tipo Coche a coches.
- eliminarCoche: Elimina un tipo Coche de coches.
- añadirColCoches: Añade una colección de tipos Coche a coches.
- existeCochePrecioMenor: Devuelve un ``Boolean`` que es ``true`` si existe un tipo Coche con un precio menor a uno dado.
- getMediaLitros: Devuelve un ``Integer`` que es la media de capacidad del motor de los coches.
- getCochesPorMarca: Devuelve una ``List<Coche>`` con los tipos Coche que sean de la marca dada.
- getCochesPorFecha: Devuelve un ``Map<LocalDate,Set<Coche>>`` que agrupa los tipos Coche por fecha.
- getNumeroCochesPorAnyo: Devuelve un ``Map<Integer,Long>`` que cuenta el número de tipos Coche y los agrupa por año.
- toString: Formatea el tipo en un String legible.
- hashCode: Generea un hashcode.
**MÉTODOS USANDO STREAMS**
- existeCochePrecioMenorStream: Devuelve un ``Boolean`` que es ``true`` si existe un tipo Coche con un precio menor a uno dado.
- getMediaLitrosStream: Devuelve un ``Integer`` que es la media de capacidad del motor de los coches.
- getCochesPorMarcaStream: Devuelve una ``List<Coche>`` con los tipos Coche que sean de la marca dada.
- getCocheMasCaroPorMarca: Devuelve un tipo ``Coche`` el cual tiene la propiedad Precio más alta de entre todos los de la marca dada.
- getFiltroPrecioOrdenadoPorMarca: Devuelve una ``List<Coche>`` ordenada por orden natural y habiendo filtrado sus tipos ``Coche`` anteriormente por un precio dado (siendo mayor o menor que este).
- getCochesPorFechaStream: Devuelve un ``Map<LocalDate, Set<Coche>>`` agrupando los coches por su fecha de salida, es decir, la clave es la fecha y el valor el conjunto de coches de esa fecha.
- getFabricantesDistintos: Devuelve una ``List<String>`` que contiene los nombres de los fabricantes distintos sin repetición.
- getCochesMasCarosPorFecha: Devuelve un ``Map<LocalDate, Coche>`` donde la clave es la fecha de salida al mercado y el valor el coche más caro de esa fecha.
- getCochesConMejorMotorPorFabricante: Devuelve un ``SortedMap<String, List<Coche>>`` donde la clave es el fabricante y el valor es la lista de coches ordenados por la comparación de orden natural de los motores.
- getCocheMasCaro: Devuelve una String con el fabricante, modelo y fecha del coche más caro de todos.
### 🔷 **Tipo FactoriaCoches**
Tipo para leer fichero CSV y parsear cadenas del CSV.
**MÉTODOS**:
- leerCoches: Lee el fichero CSV y devuelve un tipo Concesionario.
- parseaCoches: Parsea un string tipo ``"Fabricante;Modelo;Tamaño;Potencia;Capacidad;Eficiencia;Tipo;Precio;salidaMercado;listaColores"`` para crear un tipo Coche.
## 🟥 Tipos auxiliares
### 🔷 **Motor**
Tipo auxiliar que funciona como subtipo de los tipos Coche para definir el Motor de los coches.
**PROPIEDADES**:
| Propiedad | Tipo | Descripción |
|-------------|-----------------------|----------------------------------------|
tamaño | ``Double`` | consultable y modificable.
potencia | ``Integer`` | consultable y modificable.
capacidad | ``Double`` | consultable y modificable.
eficiencia | ``Integer`` | consultable y modificable.
**CONSTRUCTORES**:
- **C1:** Un parámetro por cada propiedad.
- **C2:** Constructor a partir de String.
**CRITERIO DE IGUALDAD**:
- Sirve para saber si dos objetos tipo Motor son iguales.
**CRITERIO DE ORDENACIÓN**:
- Compara propiedad por propiedad de dos tipos Motor.
**OTRAS OPERACIONES**:
- toString: Formatea el tipo en un String legible.
- hashCode: Generea un hashcode.
### 🔷 **TipoCoche**
Enumerado para el tipo de vehículo, si es Passenger o Car.
### 🔷 **ColorCoche**
Enumerado para los colores.
## 🟥 Tipos útiles
### 🔷 **Checkers**:
Métodos para lanzar excepciones con mensajes de error custom.
### 🔷 **Fichero**:
Métodos para leer ficheros y manejar sus datos.
### 🔷 **Mostrar**:
Método para mostrar n elementos de una colección.
### 🔷 **Parsers**:
Método para parsear algunos tipos.

View File

@@ -0,0 +1,145 @@
package fp.coches;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import fp.common.ColorCoche;
import fp.common.Motor;
import fp.common.TipoCoche;
import fp.utiles.Checkers;
import fp.utiles.Parsers;
public class Coche implements Comparable<Coche>{
private String fabricante;
private String modelo;
private Motor motor;
private TipoCoche tipo;
private Integer precio;
private LocalDate salidaMercado;
private List<ColorCoche> listaColores = new ArrayList<ColorCoche>();
public Coche(String fab,String mod,Motor motor,TipoCoche tipo,Integer prec,LocalDate salMerc,List<ColorCoche> cols) {
/* Constructor que recibe todas las propiedades básicas para
* luego generar tipos base con dichas propiedades.
*/
Checkers.check("El precio no puede ser negativo",prec>=0);
Checkers.check("Los colores no pueden ser null", listaColores!=null);
this.fabricante = fab;
this.modelo = mod;
this.motor = motor;
this.tipo = tipo;
this.precio = prec;
this.salidaMercado = salMerc;
this.listaColores = cols;
}
public Coche(String fab, String mod, List<ColorCoche> cols) {
/* Constructor que recibe el nombre del fabricante (String),
* el modelo (String) y una lista de colores (List<ColorCoche>)
* para generar tipos base pero con propiedades reducidas y
* consideradas importantes.
*/
Checkers.check("Los colores no pueden ser null", listaColores!=null);
this.fabricante = fab;
this.modelo = mod;
this.listaColores = cols;
}
//GETTERS Y SETTERS
public String getFabricante() {
return fabricante;
}
public String getModelo() {
return modelo;
}
public Motor getMotor() {
return motor;
}
public Integer getPrecio() {
return this.precio;
}
public void setPrecio(Integer precio) {
this.precio = precio;
}
public LocalDate getSalidaMercado() {
return salidaMercado;
}
public TipoCoche getTipo() {
return tipo;
}
public List<ColorCoche> getListaColores() {
return listaColores;
}
//FORMATO CORTO
public String getFormatoCorto() {
return getFabricante() + " " +
getModelo() + " (" +
getPrecio() + "€) - " +
getTipo() + " - " +
Parsers.salidaMercadoParser(getSalidaMercado()) + " - " +
getListaColores();
}
//TOSTRING
@Override
public String toString() {
return "Coche [fabricante=" + fabricante + ", modelo=" + modelo + ", motor=" + motor + ", tipo=" + tipo
+ ", precio=" + precio + ", salidaMercado=" + salidaMercado + ", listaColores=" + listaColores + "]";
}
// HASHCODE
@Override
public int hashCode() {
return Objects.hash(fabricante, listaColores, modelo, motor, precio, salidaMercado, tipo);
}
// EQUALS
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Coche other = (Coche) obj;
return Objects.equals(fabricante, other.fabricante) && Objects.equals(listaColores, other.listaColores)
&& Objects.equals(modelo, other.modelo) && Objects.equals(motor, other.motor)
&& Objects.equals(precio, other.precio) && Objects.equals(salidaMercado, other.salidaMercado)
&& tipo == other.tipo;
}
// COMPARETO
@Override
public int compareTo(Coche c) {
// Compara todas las propiedades en cascada
int res;
if(c==null) {
throw new NullPointerException();
}
res = getFabricante().compareTo(c.getFabricante());
if(res == 0) {
res = getModelo().compareTo(c.getModelo());
if(res==0) {
res = getMotor().compareTo(c.getMotor());
if(res==0) {
res = getPrecio().compareTo(c.getPrecio());
if(res==0) {
res = getSalidaMercado().compareTo(c.getSalidaMercado());
}
}
}
}
return res;
}
}

View File

@@ -0,0 +1,333 @@
package fp.coches;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.function.Function;
import java.util.stream.Collector;
import java.util.stream.Collectors;
import java.util.stream.Stream;
public class Concesionario {
private Set<Coche> coches;
public Concesionario() {
/* Constructor vacío */
super();
this.coches = new HashSet<Coche>();
}
public Concesionario(Set<Coche> c) {
/* Constructor que recibe un Set<Coche> para generar
* un tipo contenedor
*/
super();
this.coches = c;
}
public Concesionario(Stream<Coche> streamCoche) {
/* Constructor que recibe las propiedades básicas y un stream
* del tipo base para generar un tipo contenedor a través del
* stream */
super();
this.coches = streamCoche.collect(Collectors.toCollection(() -> new HashSet<Coche>()));
}
//HASHCODE
@Override
public int hashCode() {
return Objects.hash(coches);
}
//EQUALS
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Concesionario other = (Concesionario) obj;
return Objects.equals(coches, other.coches);
}
//GETTERS
public Set<Coche> getCoches() {
return new HashSet<Coche>(coches);
}
public Integer getNumeroCoches() {
/* Método que no recibe parámetros y devuelve
* el número de tipos base en el tipo contenedor */
return coches.size();
}
public void añadirCoche(Coche c) {
/* Método que añade un tipo base al
* tipo contenedor */
coches.add(c);
}
public void eliminarCoche(Coche c) {
/* Método que elimina un tipo base del
* tipo contenedor */
coches.remove(c);
}
public void añadirColCoches(Collection<Coche> cc) {
/* Método que recibe como parámetro una colección
* de tipos base y la añade al tipo contenedor */
coches.addAll(cc);
}
public Boolean existeCochePrecioMenor(Integer p) {
/* Métoto que recibe como parámetro un entero p
* y devuelve true si existe un coche con precio
* menor a p */
Boolean res = false;
for(Coche c:coches) {
if(c.getPrecio()<p) {
res = true;
break;
}
}
return res;
}
public Double getMediaLitros() {
/* Método que no recibe parámetros y devuelve
* la media de litros de todos los tipos Motor
* de los tipos base en el tipo contenedor */
Double aux = 0.0;
for(Coche c:coches) {
aux+=c.getMotor().getTamaño();
}
return aux/coches.size();
}
public List<Coche> getCochesPorMarca(String marca){
/* Método que recibe un String que es la marca
* para luego devolver una lista de tipos base
* filtrando por la marca dada */
List<Coche> aux = new ArrayList<Coche>();
for(Coche c:coches) {
if(c.getFabricante().equals(marca)) {
aux.add(c);
}
}
return aux;
}
public Map<LocalDate,Set<Coche>> getCochesPorFecha(){
/* Método que no recibe parámetros y devuelve un map
* que tiene como clave la fecha de salida y como valor el
* conjunto de tipos base que salieron en dicha fecha */
Map<LocalDate,Set<Coche>> res = new HashMap<LocalDate,Set<Coche>>();
for(Coche c: coches) {
LocalDate key = c.getSalidaMercado();
if(res.containsKey(key)) {
res.get(key).add(c);
} else {
Set<Coche> aux = new HashSet<Coche>();
aux.add(c);
res.put(key, aux);
}
}
return res;
}
public Map<Integer, Long> getNumeroCochesPorAnyo(){
/* Método para obtener en un map el número de coches agrupados por año */
Map<Integer, Long> res = new HashMap<Integer, Long>();
for(Coche c: coches) {
Integer key = c.getSalidaMercado().getYear();
if(res.containsKey(key)) {
Long aux = res.get(key);
aux++;
res.put(key, aux);
} else {
res.put(key, 1l);
}
}
return res;
}
/* MÉTODOS REHECHOS CON STREAMS PARA ENTREGA 3 */
public Boolean existeCochePrecioMenorStream(Integer p) {
/* Método que recibe como parámetro un entero p
* y devuelve true si existe un coche con precio
* menor a p */
return getCoches().stream()
.anyMatch(x -> x.getPrecio()<p);
}
public Double getMediaLitrosStream() {
/* Método que no recibe parámetros y devuelve
* la media de litros de todos los tipos Motor
* de los tipos base en el tipo contenedor */
return getCoches().stream()
.mapToDouble(x -> x.getMotor().getTamaño())
.average().getAsDouble();
}
public List<Coche> getCochesPorMarcaStream(String marca){
/* Método que recibe un String que es la marca
* para luego devolver una lista de tipos base
* filtrando por la marca dada */
return getCoches().stream()
.filter(x -> x.getFabricante().equals(marca))
.toList();
}
public Coche getCocheMasCaroPorMarca(String marca) {
/* Método que recibe un String que es la marca
* para luego devolver un objeto del tipo base
* con la propiedad del precio en su valor máximo
* y filtrando por la marca dada */
return getCoches().stream()
.filter(x -> x.getFabricante().equals(marca))
.max(Comparator.comparing(Coche::getPrecio))
.get();
}
public List<Coche> getFiltroPrecioOrdenadoPorMarca(Integer precio) {
/* Método que recibe un precio para primero filtrar
* los tipos base del contenedor por este (siendo
* el precio del tipo base menor o igual al dado).
* Luego se ordena por marca y se devuelve una lista. */
return getCoches().stream()
.filter(x -> x.getPrecio() <= precio)
.sorted(Comparator.comparing(Coche::getFabricante))
.toList();
}
public Map<LocalDate, Set<Coche>> getCochesPorFechaStream(){
/* Método que no recibe parámetros y devuelve un map
* que tiene como clave la fecha de salida y como valor el
* conjunto de tipos base que salieron en dicha fecha */
return getCoches().stream()
.collect(Collectors.groupingBy(x -> x.getSalidaMercado(),
Collectors.toSet()));
}
public List<String> getFabricantesDistintos() {
/* Método que no recibe parámetros y devuelve una
* lista con los nombres de los fabricantes
* sin repetirse ninguno */
return getCoches().stream()
.map(Coche::getFabricante)
.distinct()
.collect(Collectors.collectingAndThen(Collectors.toList(),
lista -> List.copyOf(lista)));
}
public Map<LocalDate, Coche> getCochesMasCarosPorFecha() {
/* Método que no recibe parámetros y devuelve un map
* que tiene como clave la fecha de salida al mercado
* y como valor el coche más caro de esa fecha */
return getCoches().stream()
.sorted(Comparator.comparing(Coche::getPrecio))
.collect(Collectors.groupingBy(Coche::getSalidaMercado,
Collectors.collectingAndThen(Collectors.toList(),
lista -> List.copyOf(lista)
.stream()
.max(Comparator.comparing(Coche::getPrecio)).get())));
}
public SortedMap<String, List<Coche>> getCochesConMejorMotorPorFabricante() {
/* Método que no recibe parámetros y devuelve un map
* que tiene como clave el nombre del fabricante y como
* valor una lista de coches coches ordenados por la
* comparación de orden natural de los motores */
return getCoches().stream()
.sorted(Comparator.comparing(Coche::getMotor))
.collect(Collectors.groupingBy(
Coche::getFabricante,
TreeMap::new,
Collectors.toList()
));
}
public String getCocheMasCaro() {
/* Método que no recibe parámetros y devuelve el coche más
* caro de entre todos y su fecha de salida. */
Map<LocalDate,Coche> mapaCoches = getCochesMasCarosPorFecha();
Coche masCaro = mapaCoches.values().stream()
.max(Comparator.comparing(Coche::getPrecio))
.get();
return masCaro.getFabricante()+" "+masCaro.getModelo()+" ("+masCaro.getSalidaMercado()+")";
}
// DEFENSA ==================================================================================
public Double getMediaPreciosDelFabricante(String fabricante) {
/* Recibe un String que es el fabricante y devuelve la media
* de los precios de los coches de ese fabricante. */
return getCoches().stream()
.filter(x->x.getFabricante().equals(fabricante))
.mapToDouble(x -> x.getPrecio())
.average().getAsDouble();
}
public Double getMediaPreciosDelFabricanteBucle(String fabricante) {
/* Recibe un String que es el fabricante y devuelve la media
* de los precios de los coches de ese fabricante. */
Double i = 0.0;
Integer n = 0;
for(Coche c:getCoches()) {
if(c.getFabricante().equals(fabricante)) {
n++;
i+=c.getPrecio();
}
}
return i/n;
}
public Integer getMedianaPreciosDelFabricante(String fabricante) {
/* Recibe un string que es el fabricante por el que se filtrará.
* Luego calcula una lista de precios de los coches de ese fabricante.
* Por último calcula la mediana de los precios.
* Sea n el número total de datos:
* - Si es impar -> mediana = n/2
* - Si es par -> mediana = ((n/2)+(n/2)-1)/2 */
Integer res = 0;
Function<Coche,Integer> f = x->x.getPrecio();
List<Integer> listaPrecios = getCoches().stream()
.filter(x->x.getFabricante().equals(fabricante))
.collect(Collectors.toList())
.stream()
.map(f).collect(Collectors.toList());
Integer n = listaPrecios.size();
if(n%2!=0) {
res = listaPrecios.get(n/2);
} else if(n%2==0) {
res = (listaPrecios.get(n/2)+listaPrecios.get((n/2)-1))/2;
}
return res;
}
public Map<String, Integer> getPorcentajeCochesConPrecioMayorA(Double p) {
Function<Coche,Integer> f = x->x.getPrecio();
return getCoches().stream()
.filter(x->x.getPrecio()>p)
.collect(Collectors.groupingBy(Coche::getFabricante,
Collectors.collectingAndThen(Collectors.toList(),f)));
}
}

View File

@@ -0,0 +1,71 @@
package fp.coches;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Stream;
import fp.common.ColorCoche;
import fp.common.Motor;
import fp.common.TipoCoche;
import fp.utiles.Fichero;
public class FactoriaCoches {
/* Lee el fichero CSV y devuelve un tipo Concesionario cuya única
* propiedad es un Set de tipos Coche*/
public static Concesionario leerCoches(String rutaFichero) {
List<String> lista = Fichero.leerFichero(rutaFichero, true);
Set<Coche> aux = new HashSet<Coche>();
for(String s:lista) {
aux.add(parseaCoches(s));
}
return new Concesionario(aux);
}
public static List<String> leeAtributos(String rutaFichero){
List<String> lista = Fichero.leerFichero(rutaFichero, false);
String strAttrs = lista.get(0);
String[] strAttrsTrozos = strAttrs.split(";");
List<String> res = Arrays.asList(strAttrsTrozos);
return res;
}
public static Concesionario leerCochesStream(String rutaFichero) {
List<String> lista = Fichero.leerFichero(rutaFichero, true);
Stream<Coche> streamCoche = lista.stream().map(FactoriaCoches::parseaCoches);
return new Concesionario(streamCoche);
}
public static Coche parseaCoches(String cocheString) {
/* Parsea un string tipo
* "Fabricante;Modelo;Tamaño;Potencia;Capacidad;Eficiencia;Tipo;Precio;salidaMercado;listaColores"
* para crear un tipo Coche*/
String[] csa = cocheString.split(";");
String fabricante = csa[0].trim();
String modelo = csa[1].trim();
Motor motor = new Motor(csa[6].trim()+";"+csa[7].trim()+";"+csa[12].trim()+";"+csa[13].trim());
TipoCoche tipo = TipoCoche.valueOf(csa[4]);
Integer precio = (int) (Double.parseDouble(csa[5].trim())*1000);
LocalDate salidaMercado = LocalDate.parse(csa[14].trim(),
DateTimeFormatter.ofPattern("dd/MM/yyyy"));
String colores = null;
if(Arrays.asList(csa).size()==20) {
colores = csa[15]+","+csa[16]+","+csa[17]+","+csa[18]+","+csa[19];
} else if(Arrays.asList(csa).size()==19) {
colores = csa[15]+","+csa[16]+","+csa[17]+","+csa[18];
}
List<String> listaColoresString = Arrays.asList(colores.split(","));
List<ColorCoche> listaColores = new ArrayList<ColorCoche>();
for(String s:listaColoresString) {
listaColores.add(ColorCoche.valueOf(s));
}
return new Coche(fabricante,modelo,motor,tipo,precio,salidaMercado,listaColores);
}
}

View File

@@ -0,0 +1,12 @@
package fp.coches;
import java.util.List;
public class TestFactoriaDefensa {
public static void main(String[] args) {
List<String> listAttrs = FactoriaCoches.leeAtributos("./data/Coches.csv");
for(int i = 0; i<listAttrs.size(); i++) {
System.out.println("Atributo "+i+": "+listAttrs.get(i)+"\n");
}
}
}

View File

@@ -0,0 +1,88 @@
package fp.coches.test;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;
import fp.coches.Coche;
import fp.common.ColorCoche;
import fp.common.Motor;
import fp.common.TipoCoche;
public class TestCoche {
private static List<ColorCoche> listaColores1 = new ArrayList<ColorCoche>();
private static Coche c1 = new Coche("Audi","A4",new Motor(1.8,150,13.2,28),TipoCoche.Passenger,23990,LocalDate.of(2015, 8, 15),listaColores1);
private static List<ColorCoche> listaColores2 = new ArrayList<ColorCoche>();
private static Coche c2 = new Coche("Volkswagen","Passat",new Motor(1.8,150,13.2,28),TipoCoche.Passenger,21200,LocalDate.of(2014, 10, 30),listaColores2);
public static void print(Object o) {
System.out.println(o);
}
private static void TesteoCoche() {
print("\n-------------- PRUEBA DEL OBJETO c1 --------------");
print("Formato completo:");
print(c1);
print("Formato corto:");
print(c1.getFormatoCorto());
print("--------------------------------------------------");
print("\n-------------- PRUEBA DEL OBJETO c2 --------------");
print("Formato completo:");
print(c2);
print("Formato corto:");
print(c2.getFormatoCorto());
print("--------------------------------------------------");
}
private static void TestCompareTo() {
print("\n-------------- PRUEBA DEL compareTo --------------");
print(c1.compareTo(c2));
if(c1.compareTo(c2)<0) {
print(c1.getFabricante()+" "+c1.getModelo() + " va antes que " + c2.getFabricante()+" "+c2.getModelo());
} else if(c1.compareTo(c2)>0) {
print(c1.getFabricante()+" "+c1.getModelo() + " va después que " + c2.getFabricante()+" "+c2.getModelo());
} else {
print(c1.getFabricante()+" "+c1.getModelo() + " y " + c2.getFabricante()+" "+c2.getModelo() + " son iguales");
}
print("--------------------------------------------------");
}
private static void TestEquals() {
print("\n--------------- PRUEBA DEL equals ---------------");
print(c1.equals(c2));
if(c1.equals(c2)==true) {
print(c1.getFabricante()+" "+c1.getModelo()+" es igual que "+c2.getFabricante()+" "+c2.getModelo());
} else {
print(c1.getFabricante()+" "+c1.getModelo()+" es distinto a "+c2.getFabricante()+" "+c2.getModelo());
}
print("--------------------------------------------------");
}
private static void TestMotor() {
print("\n-------------- PRUEBA DEL OBJETO Motor -----------");
print("c1: " + c1.getMotor());
print("c2: " + c2.getMotor());
print("--------------------------------------------------");
}
public static void llenarListas() {
listaColores1.add(ColorCoche.NEGRO);
listaColores1.add(ColorCoche.ROJO);
listaColores1.add(ColorCoche.BLANCO);
listaColores1.add(ColorCoche.AZUL);
listaColores2.add(ColorCoche.NEGRO);
listaColores2.add(ColorCoche.ROJO);
listaColores2.add(ColorCoche.BLANCO);
listaColores2.add(ColorCoche.AZUL);
}
public static void main(String[] args) {
llenarListas();
TesteoCoche();
TestMotor();
TestEquals();
TestCompareTo();
}
}

View File

@@ -0,0 +1,120 @@
package fp.coches.test;
import java.util.List;
import java.util.Scanner;
import fp.coches.Coche;
import fp.coches.Concesionario;
import fp.coches.FactoriaCoches;
import fp.utiles.Mostrar;
public class TestConcesionario {
private static Concesionario setCo = FactoriaCoches.leerCoches("./data/coches.csv");
public static void print(Object o) {
System.out.println(o);
}
public static void initOptions() {
print("Elige una opción: ");
print("1. Métodos normales");
print("2. Métodos con Stream");
}
public static void TesteoConcesionario() {
print("\n-------------- PRUEBA DE getNumeroCoches --------------");
print("Número de coches: \n" + setCo.getNumeroCoches());
print("---------------------------------------------------------");
print("\n-------------- PRUEBA DE existeCochePrecioMenor --------------");
print("Existe coche con precio < 15000: \n" + setCo.existeCochePrecioMenor(15000));
print("----------------------------------------------------------------");
print("\n-------------- PRUEBA DE getMediaLitros --------------");
print("Media del tamaño del motor: \n" + setCo.getMediaLitros());
print("--------------------------------------------------------");
print("\n-------------- PRUEBA DE getCochesPorMarca --------------");
print("Coches de la marca Chevrolet:");
List<Coche> listaFiltradaCoches = setCo.getCochesPorMarca("Chevrolet");
Mostrar.mostrar(listaFiltradaCoches, listaFiltradaCoches.size());
print("-----------------------------------------------------------");
print("\n-------------- PRUEBA DE getCochesPorFecha --------------");
print("Coches por fecha: \n" + setCo.getCochesPorFecha());
print("-----------------------------------------------------------");
print("\n-------------- PRUEBA DE getNumeroCochesPorAnyo --------------");
print("Número de coches por año: \n" + setCo.getNumeroCochesPorAnyo());
print("----------------------------------------------------------------");
}
public static void TesteoConcesionarioStream() {
print("\n-------------- PRUEBA DE existeCochePrecioMenorStream --------------");
print("Existe coche con precio < 15000: \n" + setCo.existeCochePrecioMenorStream(15000));
print("----------------------------------------------------------------");
print("\n-------------- PRUEBA DE getMediaLitrosStream --------------");
print("Media del tamaño del motor: \n" + setCo.getMediaLitrosStream());
print("--------------------------------------------------------");
print("\n-------------- PRUEBA DE getCochesPorMarcaStream --------------");
print("Coches de la marca Chevrolet:");
List<Coche> listaFiltradaCoches = setCo.getCochesPorMarcaStream("Chevrolet");
Mostrar.mostrar(listaFiltradaCoches, listaFiltradaCoches.size());
print("-----------------------------------------------------------");
print("\n-------------- PRUEBA DE getCocheMasCaroPorMarca --------------");
print("Coche de la marca Audi más caro: \n" + setCo.getCocheMasCaroPorMarca("Audi"));
print("----------------------------------------------------------------");
print("\n-------------- PRUEBA DE getFiltroPrecioOrdenadoPorMarca --------------");
print("Coches con precio <= 35000€ ordenados por marca:");
List<Coche> aux = setCo.getFiltroPrecioOrdenadoPorMarca(35000);
Mostrar.mostrar(aux, aux.size());
print("----------------------------------------------------------------");
print("\n-------------- PRUEBA DE getCochesPorFechaStream --------------");
print("Coches por fecha: \n" + setCo.getCochesPorFechaStream());
print("-----------------------------------------------------------");
print("\n-------------- PRUEBA DE getFabricantesDistintos --------------");
print("Fabricantes distintos: \n" + setCo.getFabricantesDistintos());
print("-----------------------------------------------------------");
print("\n-------------- PRUEBA DE getCochesMasCarosPorFecha --------------");
print("Coches más caros por fecha: \n" + setCo.getCochesMasCarosPorFecha());
print("-----------------------------------------------------------");
print("\n-------------- PRUEBA DE getCochesConMejorMotorPorFabricante --------------");
print("Coches con mejor motor por Fabricante: \n" + setCo.getCochesConMejorMotorPorFabricante());
print("-----------------------------------------------------------");
print("\n-------------- PRUEBA DE getCocheMasCaro --------------");
print("Coche más caro de todos y su fecha: \n" + setCo.getCocheMasCaro());
print("-----------------------------------------------------------");
}
public static void main(String[] args) {
/* Se puede elegir ver los métodos normales
* o implementados con Stream para no tener que
* hacer scroll todo el rato para verlos. */
initOptions();
Scanner input = new Scanner(System.in);
int opcion = input.nextInt();
input.close();
while(true) {
if(opcion == 1) {
TesteoConcesionario();
break;
} else if(opcion == 2) {
TesteoConcesionarioStream();
break;
} else {
print("Error");
break;
}
}
}
}

View File

@@ -0,0 +1,20 @@
package fp.coches.test;
import fp.coches.Concesionario;
import fp.coches.FactoriaCoches;
public class TestConcesionarioDefensa {
private static Concesionario setCo = FactoriaCoches.leerCoches("./data/coches.csv");
public static void print(Object o) {
System.out.println(o);
}
public static void main(String[] args) {
print("Media de precios de Audi: "+setCo.getMediaPreciosDelFabricante("Audi"));
print("Media de precios de Audi (Bucle): "+setCo.getMediaPreciosDelFabricanteBucle("Audi"));
print("Mediana de precios de Acura: "+setCo.getMedianaPreciosDelFabricante("Audi"));
print("Porcentaje de coches con precio mayor a 15000: "+setCo.getPorcentajeCochesConPrecioMayorA(15000.0));
}
}

View File

@@ -0,0 +1,27 @@
package fp.coches.test;
import fp.coches.FactoriaCoches;
import fp.utiles.Mostrar;
public class TestFactoriaCoches {
public static void print(Object o) {
System.out.println(o);
}
public static void TestFactoria() {
print("-------------- PRUEBA DE FactoriaCoches -----------");
print("[leerCoches]");
Mostrar.mostrar(FactoriaCoches.leerCoches("./data/Coches.csv").getCoches(), 10);
print(".\n.\n.");
print("[leerCochesStream]");
Mostrar.mostrar(FactoriaCoches.leerCochesStream("./data/Coches.csv").getCoches(), 10);
print(".\n.\n.");
print("---------------------------------------------------");
}
public static void main(String[] args) {
// TODO Apéndice de método generado automáticamente
TestFactoria();
}
}

View File

@@ -0,0 +1,15 @@
package fp.common;
public enum ColorCoche {
ROJO("ROJO"),NEGRO("NEGRO"),AMARILLO("AMARILLO"),AZUL("AZUL"),VERDE("VERDE"),BLANCO("BLANCO"),GRIS("GRIS");
private String color;
ColorCoche(String s){
this.color = s;
}
public String getTipo() {
return color;
}
}

View File

@@ -0,0 +1,83 @@
package fp.common;
import java.util.Objects;
public class Motor implements Comparable<Motor> {
private Double tamaño;
private Integer potencia;
private Double capacidad;
private Integer eficiencia;
public Motor(double tamaño, int potencia, double capacidad, int eficiencia) {
/* Constructor que recibe todas las propiedades */
this.tamaño = tamaño;
this.potencia = potencia;
this.capacidad = capacidad;
this.eficiencia = eficiencia;
}
public Motor(String s) {
/* Constructor a partir de String */
String[] partes = s.split(";");
this.tamaño = Double.valueOf(partes[0].trim());
this.potencia = Integer.decode(partes[1].trim());
this.capacidad = Double.valueOf(partes[2].trim());
this.eficiencia = Integer.decode(partes[3].trim());
this.eficiencia = Integer.decode(partes[3].trim());
}
// GETTERS
public Double getTamaño() {
return tamaño;
}
public Integer getPotencia() {
return potencia;
}
public Double getCapacidad() {
return capacidad;
}
public Integer getEficiencia() {
return eficiencia;
}
//TOSTRING
@Override
public String toString() {
return "Motor [tamaño=" + tamaño + ", potencia=" + potencia + ", capacidad=" + capacidad + ", eficiencia="
+ eficiencia + "]";
}
//HASHCODE
@Override
public int hashCode() {
return Objects.hash(capacidad, eficiencia, potencia, tamaño);
}
//EQUALS
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Motor other = (Motor) obj;
return Objects.equals(capacidad, other.capacidad) && Objects.equals(eficiencia, other.eficiencia)
&& Objects.equals(potencia, other.potencia) && Objects.equals(tamaño, other.tamaño);
}
//COMPARETO
@Override
public int compareTo(Motor o) {
// Compara todas las propiedades
this.getTamaño().compareTo(o.getTamaño());
this.getPotencia().compareTo(o.getPotencia());
this.getCapacidad().compareTo(o.getCapacidad());
this.getEficiencia().compareTo(o.getEficiencia());
return 0;
}
}

View File

@@ -0,0 +1,15 @@
package fp.common;
public enum TipoCoche {
Passenger("PASSENGER"), Car("CAR");
private String tipo;
TipoCoche(String s){
this.tipo = s;
}
public String getTipo() {
return tipo;
}
}

View File

@@ -0,0 +1,43 @@
package fp.utiles;
/**
* @author reinaqu
* Clase de utilidad con m<>todos para facilitar la gesti<74>n de restricciones.
*/
public class Checkers {
/**
* @param textoRestriccion
* Mensaje que se incluir<69> en la excepci<63>n elevada
* @param condicion
* Expresi<73>n booleana que ha de cumplirse para que no se eleve una excepci<63>n
* @throws IllegalArgumentException si no se cumple la condici<63>n
*
*/
public static void check(String textoRestriccion, Boolean condicion) {
if (!condicion) {
throw new IllegalArgumentException(
Thread.currentThread().getStackTrace()[2].getClassName() +
"." +
Thread.currentThread().getStackTrace()[2].getMethodName() +
": " +
textoRestriccion);
}
}
/**
* @param parametros Lista de par<61>metros para los que se quiere realizar una comprobaci<63>n de nulidad.
* @throws IllegalArgumentException si alguno de los par<61>metros es nulo.
*/
public static void checkNoNull(Object... parametros) {
for (int i = 0; i < parametros.length; i++) {
if (parametros[i] == null) {
throw new IllegalArgumentException(
Thread.currentThread().getStackTrace()[2].getClassName() +
"." +
Thread.currentThread().getStackTrace()[2].getMethodName() +
": el parametro " + (i + 1) + " es nulo");
}
}
}
}

View File

@@ -0,0 +1,53 @@
package fp.utiles;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.List;
public class Fichero {
public static List<String> leerFichero(String nomfich){
/* Método que recibe un String que es la ruta del fichero a leer
* para luego intentar leer el fichero por línea y asignarlo en l.
* Lanza una IOException si hay algún error al leer el fichero.
* Devuelve la lista de Strings de haber leído el fichero. */
List<String> l=null;
try {
l = Files.lines(Paths.get(nomfich),StandardCharsets.UTF_8).toList();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
// l.remove((int) 0);
return l;
}
public static List<String> leerFichero(String nomfich, Boolean quitarCabecera){
/* Método exactamente igual que el anterior pero que recibe un booleano
* como parámetro para elegir quitar la cabecera del CSV en caso de que
* tenga */
List<String> l=null;
try {
l = Files.readAllLines(Paths.get(nomfich),StandardCharsets.UTF_8);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if(quitarCabecera) {
l.remove((int) 0);
}
return l;
}
public static void escribeFichero(List<String> cadenas, String nombreFichero) {
/* Método que recibe como parámetro una lista de strings y una string que
* es la ruta del fichero donde se va a escribir dicha lista de strings
* línea por línea. Lanza una IOException si hay algún error al escribir
* en el fichero. */
try {
Files.write(Paths.get(nombreFichero), cadenas, StandardCharsets.UTF_8);
} catch(IOException e) {
System.out.println("Error en la escritura del fichero");
}
}
}

View File

@@ -0,0 +1,22 @@
package fp.utiles;
import java.util.Collection;
public class Mostrar {
/* Bucle para imprimir una cantidad n de objetos de una colección*/
public static <T> void mostrar(Collection<T> coleccion, Integer n) {
if (n> coleccion.size()) {
n= coleccion.size();
}
int i = 0;
for (T e : coleccion) {
if (i< n) {
System.out.println(e);
}else {
break;
}
i++;
}
}
}

View File

@@ -0,0 +1,23 @@
package fp.utiles;
import java.time.LocalDate;
import fp.common.TipoCoche;
public class Parsers {
/* Parsea PASSENGER y CAR del enumerado TipoCoche a los strings "Passenger" y "Car" */
public static String tipoCocheParser(TipoCoche tipo) {
String res = null;
if(tipo==TipoCoche.Passenger) {
res = "Passenger";
} else if(tipo==TipoCoche.Car) {
res = "Car";
}
return res;
}
public static String salidaMercadoParser(LocalDate fecha) {
/* Parsea la fecha a formato dd/MM/YYYY */
return fecha.getDayOfMonth() + "/" + fecha.getMonthValue() + "/" + fecha.getYear();
}
}

View File

@@ -0,0 +1,20 @@
package fp.utiles;
import java.util.HashMap;
import java.util.Map;
public class Utiles extends HashMap<Object, Object>{
/**
*
*/
private static final long serialVersionUID = 1L;
public String getKey(Object value) {
return this
.entrySet()
.stream()
.filter(entry -> value.equals(entry.getValue()))
.map(Map.Entry::getKey).toString();
}
}