Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args)
- {
- case "Options":
- System.out.println(dealership.ShowOptions());
- break;
- }
- {
- public String ShowOptions() // Responsibility: Returns the options installed on the selected car
- {
- if(selectedCar != null)
- return selectedCar.ShowOptions();
- else
- return "Please select a car first";
- }
- }
- {
- private Option[] options;
- public String ShowOptions()
- {
- options = new Option[3];
- 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 "
- + " by 15 with a turbo charger", " Type-R Wing"," For $100, you can get a wing that will help your car feel more aerodynamic.");
- options[0] = option;
- option = new Option("Wax Job","For $50 more, we will wax your car", "Paint Protection", "We will provide paint protection for $100", "Moon Roof",
- "We'll add in a Moon Roof for you for $50");
- options[1] = option;
- 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.",
- " We will add turbo to your car for $400.");
- options[2] = option;
- return option.toString();
- }
- }
- {
- private String name;
- private String name2;
- private String name3;
- private String description;
- private String description2;
- private String description3;
- public Option (String name, String description, String name2, String description2, String name3, String description3)
- {
- this.name = name;
- this.name2 = name2;
- this.name3 = name3;
- this.description = description;
- this.description2 = description2;
- this.description3 = description3;
- }
- public String toString() //Responsibility: Returns a description of the option(Name, Description)
- {
- String options = "The first option for this car has " + name + description + ", the second option for this car has" + name2 + description2 + ","
- + " and the third option for this car has" + name3 + description3 + ".";
- return options;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement