import java.util.Scanner;
class Taco {
private boolean shell;
private boolean togo;
String ingredients;
public Taco(boolean shell1, boolean togo1, String ingredients1)
{
shell = shell1;
togo = togo1;
ingredients = ingredients1;
}
public String toString() {
String ans = "";
ans += "Shell: ";
if (shell) {
ans += "hard; ";
}
else {
ans += "soft; ";
}
ans += "Eat in or out: ";
if (togo) {
ans += "out; ";
}
else {
ans += "in; ";
}
ans += "Ingredients: ";
ans += ingredients;
ans += ".";
return ans;
}
}
public class PoD{
public static void main(String []args){
Scanner scanner = new Scanner(System.in);
Taco taco;
boolean shell1 = scanner.nextBoolean();
boolean togo1 = scanner.nextBoolean();
scanner.nextLine();
String ingredients1 = scanner.nextLine();
taco = new Taco(shell1, togo1, ingredients1);
System.out.println(taco.toString());
System.out.print("END OF OUTPUT");
}
}
comment down for any queries
please give a thumbs up
Introduction For as long as you can remember, you've never been able to get a taco...
JAVA This PoD, builds off the Book class that you created on Monday (you may copy your previously used code). For today’s problem, you will add a new method to the class called lastName() that will print the last name of the author (you can assume there are only two names in the author name – first and last). You can use the String spilt (“\s”) method that will split the String by the space and will return an array...
Introduction In this final programming exercise, you'll get a chance to put together many of the techniques used during this semester while incorporating OOP techniques to develop a simple song playlist class. This playlist class allows a user to add, remove and display songs in a playlist. The Base Class, Derived Class and Test Client Unlike the other PAs you completed in zyLabs, for this PA you will be creating THREE Java files in IntelliJ to submit. You will need...
Additional code needed:
PartA: BurgerOrder class (1 point) Objective: Create a new class that represents an order at a fast-food burger joint. This class will be used in Part B, when we work with a list of orders. As vou work through this part and Part B, draw a UML diagram of each class in using the UML drawing tool 1) Create a new Lab5TestProject project in Netbeans, right-click on the lab5testproject package and select New>Java Class 2) Call your...
java This lab is intended to give you practice creating a class with a constructor method, accessor methods, mutator methods, equals method , toString method and a equals method. In this lab you need to create two separate classes, one Student class and other Lab10 class. You need to define your instance variables, accessor methods, mutator methods, constructor, toString method and equals method in Student class. You need to create objects in Lab10 class which will have your main method...
For this assignment your job is to create a two class
application that examines the concept of a numerical
palindrome.
A numerical palindrome is a non-negative whole number that is the
same forwards and backwards, e.g. 2332, 12321, etc. Here's the
catch: suppose you do the following. Start with any positive whole
number. If it's a palindrome, you're done; if it isn't, reverse the
number, add the reversal to the original value, and test this new
result. It it's a...
You are going to write an object that takes a word (or short phrase) as an input for the Constructor and then will reverse the letters in the word. The object to implement this is referred to as **ReverseWord** and consists of **only** the following public methods: **public void setWord(String word)** - Sets the word to be processed. **public String getWord()** - Returns the word that is set with **setWord**. Note that if this is called before setWord then an...
Java Concurrency! You have been given a simple API to buy and print postage. Write a program that submits each incoming order to the API and then prints the shipping label. Unfortunately each call to the shipping label API is SLOW… To compensate for this, use concurrency so that your program can be making several calls to the API at one time. We also need to keep track of our expenses, so make sure to calculate how much money is...
OUTCOMES After you finish this assignment, you will be able to do the following: Define an abstract class Create concrete classes from an abstract class Overload an operator Split classes into .h and .cpp files Open files for reading Write to files Use output manipulators such as setw, fixed, and setprecision DESCRIPTION A binary arithmetic operation takes two double operands (left and right) to perform addition, subtraction, multiplication, or division on. For example, 10 + 11 is an addition (+)...
JAVA you have been given the code for Node Class (that holds Strings) and the LinkedList Class (some methods included). Remember, you will use the LinkedList Class that we developed in class not Java’s LinkedList Class. You will add the following method to the LinkedList Class: printEvenNodes – this is a void method that prints Nodes that have even indices (e.g., 0, 2, 4, etc). Create a LinkedListDemo class. Use a Scanner Class to read in city names and store...
Overview JAVA LANGUAGE PROBLEM: The owner of a restaurant wants a program to manage online orders that come in. This program will require multiple classes. Summary class, customer class, order class and the driver class. Summary class This class will keep track of the cost of the order and output a summary, which includes the total for the order. The methods in this class are static. There are no instance variables, and instead uses an Order object that is passed...