Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please note that you are not required to implement your own generic classes for this problem. A Car dealership is attempting to shift their business

Please note that you are not required to implement your own generic classes for this problem.

A Car dealership is attempting to shift their business online and automate part of the job normally performed by people in their sales department. The project has been dubbed the AutoAutoSalesman.

Your task is to create a class called AutoAutoSalesman that will:

  • Keep track of available Car inventory (classes are provided for you).
  • Make car recommendations based on criteria provided by prospective buyers.

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.

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedI need help with this lab in java please

Q src Teslas RG- Add Configuration... Lab 7 - Polymorphism 5.0 Lab Problem 5.1 Description -Problem 5.1- Please note that you are not required to implement your own generic classes for this problem. 3 6 A Car dealership is attempting to shift their business online and automate part of the job normally performed by people in their sales department. The project has been dubbed the AutoAuto Salesman. 7 8 of Your task is to create a class called Auto Auto Salesman that will: 11 Task UML Generator UML design tool window 12 Keep track of available Car inventory (classes are provided for you). Make car recommendations based on criteria provided by prospective buyers. AutoAuto Salesman 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. o 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 : retumed Cars must have a fuelEconomy below 6.0 (litres/100km) if true. If false no preference should be made. nt PlantUML Cradle Run Done E TODO Problems - Terminal Buildi Event Log 12-1 LF UTF-B 4 spaces import O2 A1 AV public class Main { public static void main(String[] args) { // example List cars = new ArrayList Arrays. asList new FordBronco( style: "sport", price: 50000, 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: "hatchback", price: 18000, fuelEconomy: 5.1), new KiaRio( style: "hatchback", 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) ); AutoAuto Salesman aas = new AutoAuto Salesman (cars); } } public class Kiario extends Car { public Kiario (String style, double price, double fuelEconomy) { super(style, price, fuelEcono @Override public void goes() { System.out.println("Clunk"); } } 1 public class FordBronco extends Car { 2 3 public FordBronco (String style, double price, double fuelEconomy) { super(style, price, fuele 6 7 @Override public void goes() { System.out.println("VROOM"); } 8 of } 11 12 FordBronco.java KiaRio.java X 5.1 .../Main.java Tesla S.java 1.1/.../ Main.java Car.java ol public class far { 1 A1 A 2 3 4 private final String style; private final double price; private final double fuelEconomy; 5 6 7 8 9 public Car(String style, double price, double fuelEconomy) { this.style = style; this.price = price; this.fuelEconomy = fuelEconomy; } 10 11 12 13 public String getStyle() { return style; } 16 17 public double getPrice() { return price; } 20 public double getFuelEconomy () { return fuelEconomy; } 21 24 public void goes() { System.out.println("Vroom"); } 25 l 28 29 30 of 31 32 @Override public String toString() { return this.getClass().toString() + + getStyle() + + getPrice() + "" + getFuelEconomy(); } 33 34 35 36 } 37 public class Teslas extends Car { public Teslas(String style, double price, double fuelEconomy) { super(style, price, fuelEconomy); } @Override public void goes () { System.out.println(""); } } Q src Teslas RG- Add Configuration... Lab 7 - Polymorphism 5.0 Lab Problem 5.1 Description -Problem 5.1- Please note that you are not required to implement your own generic classes for this problem. 3 6 A Car dealership is attempting to shift their business online and automate part of the job normally performed by people in their sales department. The project has been dubbed the AutoAuto Salesman. 7 8 of Your task is to create a class called Auto Auto Salesman that will: 11 Task UML Generator UML design tool window 12 Keep track of available Car inventory (classes are provided for you). Make car recommendations based on criteria provided by prospective buyers. AutoAuto Salesman 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. o 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 : retumed Cars must have a fuelEconomy below 6.0 (litres/100km) if true. If false no preference should be made. nt PlantUML Cradle Run Done E TODO Problems - Terminal Buildi Event Log 12-1 LF UTF-B 4 spaces import O2 A1 AV public class Main { public static void main(String[] args) { // example List cars = new ArrayList Arrays. asList new FordBronco( style: "sport", price: 50000, 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: "hatchback", price: 18000, fuelEconomy: 5.1), new KiaRio( style: "hatchback", 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) ); AutoAuto Salesman aas = new AutoAuto Salesman (cars); } } public class Kiario extends Car { public Kiario (String style, double price, double fuelEconomy) { super(style, price, fuelEcono @Override public void goes() { System.out.println("Clunk"); } } 1 public class FordBronco extends Car { 2 3 public FordBronco (String style, double price, double fuelEconomy) { super(style, price, fuele 6 7 @Override public void goes() { System.out.println("VROOM"); } 8 of } 11 12 FordBronco.java KiaRio.java X 5.1 .../Main.java Tesla S.java 1.1/.../ Main.java Car.java ol public class far { 1 A1 A 2 3 4 private final String style; private final double price; private final double fuelEconomy; 5 6 7 8 9 public Car(String style, double price, double fuelEconomy) { this.style = style; this.price = price; this.fuelEconomy = fuelEconomy; } 10 11 12 13 public String getStyle() { return style; } 16 17 public double getPrice() { return price; } 20 public double getFuelEconomy () { return fuelEconomy; } 21 24 public void goes() { System.out.println("Vroom"); } 25 l 28 29 30 of 31 32 @Override public String toString() { return this.getClass().toString() + + getStyle() + + getPrice() + "" + getFuelEconomy(); } 33 34 35 36 } 37 public class Teslas extends Car { public Teslas(String style, double price, double fuelEconomy) { super(style, price, fuelEconomy); } @Override public void goes () { System.out.println(""); } }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Deductive And Object Oriented Databases Second International Conference Dood 91 Munich Germany December 18 1991 Proceedings Lncs 566

Authors: Claude Delobel ,Michael Kifer ,Yoshifumi Masunaga

1st Edition

3540550151, 978-3540550150

More Books

Students also viewed these Databases questions

Question

What are organization costs? List examples of these costs.

Answered: 1 week ago

Question

6. How do histories influence the process of identity formation?

Answered: 1 week ago