subject

Convert the attached C++ code to working Java code. Be judicious in the change that you make. This assignment is not about re-writing or improving this code, but rather about recognizing the differences between C++ and Java, and making the necessary coding changes to accommodate how Java does things. PLEASE DO NOT use a built-in Java QUEUE (or any other) container. Additional resources for assignment: #include
#include
using namespace std;
class pizza
{
public:
string ingrediants, address;
pizza *next;
pizza(string ingrediants, string address)
{
this->address = address;
this->ingrediants = ingrediants;
next = NULL;
}
};
void enqueue(pizza **head, pizza **tail, pizza *thispizza)
{
if (*head == NULL) *head = thispizza;
else (*tail)->next = thispizza;
*tail = thispizza;
return;
}
pizza* dequeue(pizza **head, pizza **tail)
{
pizza* pizzatodeliver = NULL;

if (*head != NULL)
{
pizzatodeliver = *head;
*head = (*head)->next;
}
if (*head == NULL) *tail = NULL;
return pizzatodeliver;
}
void deliver(pizza **head, pizza`** tail)
{
pizza *thispizza = dequeue(head, tail);
if (thispizza == NULL)
{
cout << "No deliveries pending" << endl; return;
}
cout << "Deliver a pizza with " << thispizza->ingrediants
<< " to " << thispizza->address << endl;
}
int main()
{
pizza *first = NULL, *last = NULL;
enqueue(&first, &last, new pizza("pepperoni", "1234 Bobcat Trail"));
enqueue(&first, &last, new pizza("sausage", "2345 University Drive"));
deliver(&first, &last);
enqueue(&first, &last, new pizza("extra cheese", "3456 Rickster Road"));
enqueue(&first, &last, new pizza("everything", "4567 King Court"));
enqueue(&first, &last, new pizza("coffee beans", "5678 Java Circle"));
deliver(&first, &last);
deliver(&first, &last);
deliver(&first, &last);
deliver(&first, &last);
deliver(&first, &last);
cin. get();
return 0;
}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 22:10
Is the following an example of social media viral marketing? indicate your response by selecting yes or no. when you sign onto your favorite social networking website, you get messages from friends who have seen a television show they thought was a "must see! "
Answers: 1
question
Computers and Technology, 23.06.2019 09:30
Write a function called checkfactor that takes two arrays of positive numbers, firstnumberrow and secondnumberrow. checkfactor checks if the first entry in firstnumberrow is divisible by the first entry in secondnumberrow, and performs the same operation on the next array elements until all entries have been checked. all the numbers are positive and the number of entries in the arrays are the same. the function should return the identified divisible numbers in two row arrays named firstdivisible and seconddivisible.restrictions: branches or loops should not be used. the code must use the internal mod and logical functions.hint: the mod function should be used to determine if two numbers are divisible. ex: for num1 and num2 if mod(num1,num2) is 0, then the two numbers are divisible.this is matlab
Answers: 2
question
Computers and Technology, 23.06.2019 13:30
Drag the tiles to the correct boxes to complete the pairs. match the errors with their definitions. #name #value #ref when a formula produces output that is too lengthy to fit in the spreadsheet cell arrowright when you enter an invalid cell reference in a formula arrowright when you type text in cells that accept numeric data arrowright when you type in a cell reference that doesn’t exist arrowright reset next
Answers: 1
question
Computers and Technology, 23.06.2019 13:30
Select the correct answer from each drop-down menu. which types of computer networks are bigger as well as smaller than a man? a man is a network of computers that covers an area bigger than a , but smaller than a .
Answers: 1
You know the right answer?
Convert the attached C++ code to working Java code. Be judicious in the change that you make. This a...
Questions
question
Mathematics, 21.05.2020 19:58
question
History, 21.05.2020 19:58
question
History, 21.05.2020 19:58
question
Biology, 21.05.2020 19:58
Questions on the website: 13722367