1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
SOVA2 [1]
3 years ago
8

For as long as you can remember, you've never been able to get a taco on Tuesday at your local taco truck. The lines are always

too long and the staff are very overwhelmed. You take it upon yourself to streamline the taco ordering process to decrease the average time it takes to get a taco. You decide to create a process that will take customer orders and print them out in a neat and understandable format. To increase the efficiency of your code, you're going to use the `Taco.java` class for every taco. You're going to write the process of creating a taco object from an order in `PoD.java`.Taco-shell: boolean -toGo: boolean -ingredients: String +Taco () +getShell(): boolean +get ToGo (): boolean +get.Ingredients: String +set Shell (shell: boolean) +set ToGo (togo: boolean) +setIngredients (ingredients: String) +toString(): StringOnce 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 following order (handled for you): • a boolean (shell): the shell type (true if hard shell, false if soft shell) • a boolean (to Go): 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
Computers and Technology
1 answer:
Anestetic [448]3 years ago
5 0

Answer:

import java.util.Scanner;

/*

* Class Taco

* @shell

* @togo

* @ingredients

*/

class Taco{

//Attributes

private boolean shell;

private boolean togo;

private String ingredients;

//Default constructor

public Taco() {

shell=false;

togo=false;

ingredients="";

}

//Parameterized constructor

public Taco(boolean shell,boolean togo,String ingredients) {

this.shell=shell;

this.togo=togo;

this.ingredients=ingredients;

}

//Getters and setters

public boolean isShell() {

return shell;

}

public void setShell(boolean shell) {

this.shell = shell;

}

public boolean isTogo() {

return togo;

}

public void setTogo(boolean togo) {

this.togo = togo;

}

public String getIngredients() {

return ingredients;

}

public void setIngredients(String ingredients) {

this.ingredients = ingredients;

}

//override to string

public String toString() {

String str="Shell: ";

if(shell==false) {

str+="soft\n";

}

else {

str+="hard\n";

}

str+="Order: ";

if(togo==false) {

str+="out\n";

}

else {

str+="togo\n";

}

str+="Ingredients: "+ingredients;

return str;

}

}

public class PoD {

public static void main(String[] args) {

//Scanner object for input read

Scanner sc=new Scanner(System.in);

//user inputs

System.out.print("Do you want taco shell hard or soft(true/false): ");

boolean shell=sc.nextBoolean();

System.out.print("Do you want taco in and out(true/false): ");

boolean togo=sc.nextBoolean();

sc.nextLine();

System.out.print("Enter all ingredients: ");

String ingredients=sc.nextLine();

//Create Taco object

Taco taco=new Taco(shell,togo,ingredients);

System.out.println("\n"+taco+"\n");

System.out.println("END OF OUTPUT");

}

}

You might be interested in
(True or False) The speed at which data travels on a bus is referred to as the word size.
geniusboy [140]

Answer:

True

Explanation:

4 0
3 years ago
Read 2 more answers
Suppose you use Batch Gradient Descent to train a neural network and you plot the training error at every epoch. If you notice t
Phantasy [73]

Answer:

The answer is "using validation error".

Explanation:

The validation error is used to response the test for one of the queries is activated to the participant, which may not properly answer the question. These errors go up continuously after each time, the processing rate is too high and also the method is different.  

  • These errors are also unless to increase when they are actually in the problem.  
  • The training level will be that, if the learning error may not increase when the model overrides the learning set and you should stop practicing.
6 0
3 years ago
Artificial intelligence seeks ways to improve a computer's capabilities in ____ and reasoning tasks. intellectual computational
Tatiana [17]
The answer is Computational
4 0
3 years ago
PLEASEE HELPP.... QUESTION... how does coding impact your life​
nataly862011 [7]

Answer: It allows us to do everyday tasks on the internet

Explanation: We wouldn’t be able to email, research, etc without coding!

6 0
3 years ago
Read 2 more answers
To navigate to a new web page for which you know the url, type that url in the browser’s ____ bar and press enter.
Slav-nsk [51]
It would be to type the url in the browser's address bar
3 0
3 years ago
Other questions:
  • A set of communication rules for the computer to follow is called, what?
    10·2 answers
  • What is tuple and attribute of a relation​
    11·1 answer
  • A species of snake lives in a rainforest. Which would be an adaptation for this
    10·2 answers
  • George and Miguel want to know more about their local and online competitors and about the retail industry. What is the best way
    9·1 answer
  • Which best describes color blindness?
    8·1 answer
  • A computer (mainframe, server, or workstation) that has an operating system enabling _____________ to access it at the same time
    11·1 answer
  • If Anyone can help me out that'll be great
    11·1 answer
  • A file named loan.html, write an HTML document that looks similar to figure 9-7 in the textbook. Write four functions with these
    8·1 answer
  • What is data science?​
    15·1 answer
  • Prior to the 1996 NEC, ____ receptacles and cords were permitted. However, now it is mandatory that a separate equipment groundi
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!