Question: Taco -shell: boolean -toGo: boolean -ingredients: String +Taco () +get Shell(): boolean +getToGo (): boolean +getIngredients: String +set Shell (shell: boolean) +setToGo (togo: boolean) +setIngredients

Taco -shell: boolean -toGo: boolean -ingredients: String +Taco () +get Shell(): boolean +getToGo (): boolean +getIngredients: String +set Shell (shell: boolean) +setToGo (togo: boolean) +setIngredients (ingredients: String) +toString(): String Once you've created a Taco object, the object will be printed by making use of the 'toString() method. Details (POD.java) Input The main method of PoD.java reads in input in the the following order (handled for you): a boolean (shell): the shell type (true if hard shell, false if soft shell) a boolean (toGo): if the order is to eat in or out a list of ingredients (Ingredients): an array of strings describing which ingredients are in the taco. The 'Taco.java' class accepts a single String. Processing WHAT YOU MUST DO: Create a Taco object Assign input to Taco object Print out Taco object Output Output is already done for you by making use of the toString(method in the 'Taco.java' object class Sample input/output: Sample Input Sample Output Note: This is all on a single line! false true lettuce tomato cheese Shell: soft Order: to go Ingredients: lettuce tomato cheese 7. import java.util.Scanner; 8 9- public class POD { 10 11 - public static void main( String [] args) { 12 Scanner in = new Scanner(System.in); boolean shell = in.nextBoolean(); boolean toGo = in.nextBoolean(); String ingredients = in.nextLine(); // PLEASE START YOUR CODE HERE / =========================== =========================== //PLEASE END YOUR CODE HERE System.out.println(taco); POD.Java PoDjevac Tacojevao o New Taco.Java New Il 15 iCOEL 1 Luc vaung vunu ETUI I umi115 cali LCOL. Sno 12 10 public class Taco 11 - { //attributes 13 private boolean shell; private boolean togo; private String ingredients; 15 16 17 18 //constructor public Taco() 19 20 21 shell = true; ingredients = \"none\"; togo = true; 24 25 //Getters public boolean getShell() { return shell; } public boolean getToGo() { return toGo; } public String getIngredients() {return ingredients; } 28 30 31 //Setters public void setShell(boolean shell) {this.shell = shell; } public void setToGo (boolean toGo) {this.toGo = toGo; } public void setIngredients(String ingredients) {this.ingredients = ingredients;} 32 33 35 36 public String toString() 37. 39 String order = \"\"; if (shell) order += \"Shell: hard \"; else order += \"Shell: soft \"; if (togo) order+= \"Order: to go \"; else order+= \"Order: not to go \"; order += \"Ingredients: \" + ingredients; 51 return order; 53 }

java

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 Programming Questions!