Advertisement
Guest User

Untitled

a guest
Feb 25th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.18 KB | None | 0 0
  1. public static void main(String[] args)
  2. {
  3. case "Options":
  4. System.out.println(dealership.ShowOptions());
  5. break;
  6. }
  7.  
  8. {
  9. public String ShowOptions() // Responsibility: Returns the options installed on the selected car
  10. {
  11. if(selectedCar != null)
  12. return selectedCar.ShowOptions();
  13. else
  14. return "Please select a car first";
  15. }
  16. }
  17.  
  18. {
  19. private Option[] options;
  20. public String ShowOptions()
  21. {
  22. options = new Option[3];
  23. Option option = new Option("Monthly Car Wash", " $500 and you will get a two year free car wash", " TurboCharge", " Pay $350 and increase your horsepower "
  24. + " by 15 with a turbo charger", " Type-R Wing"," For $100, you can get a wing that will help your car feel more aerodynamic.");
  25. options[0] = option;
  26.  
  27. option = new Option("Wax Job","For $50 more, we will wax your car", "Paint Protection", "We will provide paint protection for $100", "Moon Roof",
  28. "We'll add in a Moon Roof for you for $50");
  29. options[1] = option;
  30.  
  31. option = new Option("a First Aid Kit.", " For $20, we will add in a First Aid Kid", " new carpets.", " We will change the color of your carpet for $50", " TurboCharged.",
  32. " We will add turbo to your car for $400.");
  33. options[2] = option;
  34. return option.toString();
  35. }
  36. }
  37.  
  38. {
  39. private String name;
  40. private String name2;
  41. private String name3;
  42. private String description;
  43. private String description2;
  44. private String description3;
  45. public Option (String name, String description, String name2, String description2, String name3, String description3)
  46. {
  47. this.name = name;
  48. this.name2 = name2;
  49. this.name3 = name3;
  50. this.description = description;
  51. this.description2 = description2;
  52. this.description3 = description3;
  53. }
  54. public String toString() //Responsibility: Returns a description of the option(Name, Description)
  55. {
  56. String options = "The first option for this car has " + name + description + ", the second option for this car has" + name2 + description2 + ","
  57. + " and the third option for this car has" + name3 + description3 + ".";
  58. return options;
  59. }
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement