+1(316)4441378

+44-141-628-6690

Code-part2.zip

Code-part4/Product.java

Code-part4/Product.java

public class Product {
  public String name;
  public int futuristicness;
  public int practicality;

  public Product(String theName, int theFuturisticness, int thePracticality) {
    name=theName; futuristicness=theFuturisticness; practicality=thePracticality;
  }
}

__MACOSX/Code-part4/._Product.java

Code-part4/ChoiceStrategy.java

Code-part4/ChoiceStrategy.java

public interface ChoiceStrategy {
  public Product chooseBetween(Product a, Product b);
}

__MACOSX/Code-part4/._ChoiceStrategy.java

Code-part4/MostFuturisticStrategy.java

Code-part4/MostFuturisticStrategy.java

public class MostFuturisticStrategy implements ChoiceStrategy {
     // Complete this with an implementation of
    // chooseBetween(Product a, Product b) which returns
    // Product a if its futuristicness is greater than or equal
    // to that of b; and returns Product b otherwise
}


__MACOSX/Code-part4/._MostFuturisticStrategy.java

Code-part4/ProductRecommender.java

Code-part4/ProductRecommender.java

public class ProductRecommender {
  ChoiceStrategy myStrategy;

  public static void main(String args[]) {
    ProductRecommender recommender=new ProductRecommender();
    recommender.doExample();
  }

  public void doExample() {
    Product p1=new Product("DeLorean DMC-12", 5, 1);
    Product p2=new Product("LDV Maxus", 1, 5);

     System.out.println("Current strategy: choose most futuristic");
     // Add code here to create a MostFuturisticStrategy and
     // print out the chosen vehicle according to this strategy

        System.out.println("Strategy changed: choose most practical");
    // Add code here to create a MostPracticalStrategy and
    // print out the chosen vehicle according to this strategy

  }
}

__MACOSX/Code-part4/._ProductRecommender.java

Code-part4/MostPracticalStrategy.java

Code-part4/MostPracticalStrategy.java

public class MostPracticalStrategy implements ChoiceStrategy {
    // Complete this with an implementation of
    // chooseBetween(Product a, Product b) which returns
    // Product a if its practicality is greater than or equal
    // to that of b; and returns Product b otherwise
}
   

__MACOSX/Code-part4/._MostPracticalStrategy.java

 

You can place an order similar to this with us. You are assured of an authentic custom paper delivered within the given deadline besides our 24/7 customer support all through.

 

Latest completed orders:

# topic title discipline academic level pages delivered
6
Writer's choice
Business
University
2
1 hour 32 min
7
Wise Approach to
Philosophy
College
2
2 hours 19 min
8
1980's and 1990
History
College
3
2 hours 20 min
9
pick the best topic
Finance
School
2
2 hours 27 min
10
finance for leisure
Finance
University
12
2 hours 36 min
[order_calculator]