Question: Hi there I need help implementing the following code in java please AutoAutoSalesman must have the following: A collection that holds all of the available

Hi there I need help implementing the following code in java please

AutoAutoSalesman must have the following:

  • A collection that holds all of the available cars. This collection is passed as the single argument to the only constructor.
  • Auto recommendations can be based on several criteria. The criteria are: pricePoint, priceRange, ecoFriendly, style.

    Any combination of criteria may be selected by the customer, except pricePoint and priceRange, these arguments are always provided together. For example: the customer may select the price (pricePoint and priceRange) and style criteria. The recommendation algorithm would then make recommendations based on only these criteria. Another example: price may be unimportant and the customer only provided ecoFriendly.

  • getReco()
    • This is the method(s) that will return a collection of Cars meeting the criteria specified in the arguments.
    • Cars meeting the provided criteria should be determined as follows:
      • pricePoint, priceRange: returned Cars must be within +-(priceRange/2) of the pricePoint. For example: a pricePoint and priceRange of 40000 and 10000 should yield only Cars priced between 35000 and 45000.
      • style: returned Cars must have the same style (String) as the one specified.
      • ecoFriendly: returned Cars must have a fuelEconomy below 6.0 (litres/100km) if true. If false no preference should be made.

I have attached the class Car, and the testing case

Hi there I need help implementing the following code in java pleaseAutoAutoSalesman must have the following: A collection that holds all of the

src Teslas.java A1 A 4 AG Add Configuration... Lab 7 - Polymorphism 5.0 Lab Problem 5.1 C Car m getStyle Main.java AutoAuto Salesman. ava X C Car.java Ford Bronco.java x KlaRio.java 1 ! public class Car { 2 3 private final String style; private final double price; 5 private final double fuelEconomy; 6 7 public Car(String style, double price, double fuelEconomy) { 8 this.style = style; 9 this.price = price; 10 this. fuelEconomy = fuelEconomy; 11 } 12 13 E public String getStyle() { return style; 14 15 16 public double getPrice() { return price; 17 } UML Generator UML design tool window ft PlantuML Gradie 18 public double getFuelEconomy { return fuelEconomy; } public void goes() { System.out.println("Vroom"); } 19 20 21 22 of 23 24 25 26 of 27 .: 28 29 30 @Override public String toString() { return this.getClass().toString() + "" + getStyle() + -" + getPrice() + + getFuel Economy(); } 31 32 } E TODO O Problems - Terminal Event Log 13:32 LF UTF-B 4 spaces 1 0 src e Ford Bronco.java KlaRio.java Tesla S.java Add Configuration... Lab 7 - Polymorphism 5.0 Lab Problem 5.1 Main Main.java AutoAuto Salesman.java C Car.java 1 import java.util.ArrayList; 2 import java.util.Arrays; 3 import java.util.List; 01 A1 A 4 5 UML Generator 7 8 9 10 11 12 13 14 15 public class Main { public static void main(String[] args) { // example List cars = new ArrayList>( Arrays.asList new FordBronco( style: "sport", price: 58000, fuelEconomy: 8), new FordBronco( style: "turbo", price: 58000, fuelEconomy: 10), new FordBronco( style: "turbo-sport", price: 55000, fuelEconomy: 9.2), new Teslas( style: "sedan", price: 65000, fuelEconomy: 0), new Teslas( style: "sedan", price: 68000, fuelEconomy: 0), new Teslas( style: "sport", price: 75000, fuelEconomy: 0), new Teslas( style: "sport", price: 70000, fuelEconomy: 0), new KiaRio( style: Thatchback", price: 18000, fuelEconomy: 5.1), new KiaRio( style: Thatchback", price: 15000, fuelEconomy: 5.8), new KiaRio( style: "Sedan", price: 18000, fuelEconomy: 5.1), new Kiario( style: "sedan", price: 19000, fuelEconomy: 5.3), new Kiario( style: "turbo", price: 25000, fuelEconomy: 15.1) D ); UML design tool window 16 17 18 19 20 + PlantUML Gradie 21 22 23 24 25 AutoAuto Salesman aas = new AutoAutoSalesman(cars); 26 } 27 E TODO Problems - Terminal Event Log 1:8 LF UTF-B 3 spaces 10

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!