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
On laptops, wireless cards tend to be attached to which panel?
ELEN [110]

Answer:

LCD panel

Explanation:

Regularly these wireless cards tend to be attached to the LCD panel because the wireless cards have a Wi-Fi antenna to get a better signal.

Regularly the wireless card has two cables, those cables go between the hinges until arrives at the display panel (LCD panel).

There are wireless cards that are connected by the USB port, this is so useful because there are some cards welded in the motherboard.

8 0
4 years ago
The preferred means of creating multithreaded Java applications is by implementing the ________ interface. An object of a class
Kaylis [27]

Answer:

Runnable.

Explanation:

Java is an all round programming language which is typically object-oriented and class-based. It was designed by James Gosling, developed by Sun microsystems and released officially on the 23rd of May, 1995. Java programming language is designed to have only a few implementation dependencies as possible because it was intended to be written once, and run on any platform.

Java makes concurrency to be available to software developers through the application programming interface (API) and the language. Also, it supports multiple threads of execution, by making each thread have its respective program counter and method-call stack, which then allow concurrent executions with other threads.

The preferred means of creating multithreaded Java applications is by implementing the runnable interface. An object of a class that implements this interface represents a task to perform. The code is public void run ().

8 0
3 years ago
How does polling-based network receive work? How is it different than interrupt based network? Describe both functions and list
Alenkasestr [34]

In a polling-based network receives, the operating system keeps checking the status register after a fixed time interval to see whether a device needs hardware attention or not. CPU gradually checks the status of receive bit after a defined time interval of a clock and if the value of receive bit is true then data is moved from the RX register to the memory. In interrupt-based networks, whenever a device needs hardware processing then an interrupt is raised to inform the CPU for device attention. The data of the device is transferred to memory from the network card.

Polling is a protocol, not a hardware mechanism where the device gets attention by CPU. An interrupt is a hardware mechanism, not a protocol where the device gets attention by the interrupt handler. In polling, during receiving, parts of received data need to transfer to memory but in case of interrupts, whole data is transferred at once after receiving is done. An interrupt is a heavy operation as compared to pooling because hardware involves in it. For large amounts of data, Polling becomes an inefficient method. In polling, CPU gradually checks devices at regular intervals whereas the Interrupt handler can send interrupt at any time. Each device has its own Command ready bit which indicates whether the device requires servicing or not. In polling, CPU wastes numerous clock cycles by repetitively checking the command-ready little bit of each device. In Interrupt based network, the interrupt request line indicates whether the device requires servicing or not. In interrupt-based network, CPU cycles not wasted but CPU is disturbed only when device send interrupt signals.  

Relative performance between programmed I/O and DMA:

For determining the relative performance between programmed I/O and DMA, important factors are:

1. Size of data  

2. Frequency of operations

5 0
3 years ago
Which is a gallery of pr design pictures that can be inserted directly in the document​
fredd [130]

Answer:

.,.,.,.,.,.,.,.,.,.,.,.,.

6 0
3 years ago
What is the missing line of code?
nlexa [21]

Answer:

books.keys()

Explanation:

I ran the code and the awncers though python and books.keys() is the one that came up with the awncer

3 0
3 years ago
Other questions:
  • . Which game was the most popular free download in Apple®’s app store by January 2014, despite poor reviews and plagiarism accus
    14·2 answers
  • Hiding an object, such as a diary, to prevent others from finding it is an example of:______________.
    10·1 answer
  • Using Word, Maureen is writing an outline of a presentation she plans to give to her company. She will be showing a video during
    12·2 answers
  • The first step in the information systems planning process is to ___________.
    8·1 answer
  • Design and implement an application that reads an integer value representing a year from the user. The purpose of the program is
    6·1 answer
  • What is one thing the ADDIE model does NOT account for?
    14·1 answer
  • During the system investigation stage, __________ studies are done to determine if the hardware, software, and communications co
    9·1 answer
  • Bao bì chủ động active packaging và bao bì thông minh intelligent packaging khác biệt như thế nào
    15·1 answer
  • JQuery uses CSS selectors to select elements?
    5·1 answer
  • Today
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!