Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

hello can someone help, why does it give me an error on the output and what should i replace it with ? ArrayBoundedstack.java package queue;

hello can someone help, why does it give me an error on the output and what should i replace it with ?image text in transcribedimage text in transcribedimage text in transcribed

ArrayBoundedstack.java package queue; import java.util. Scanner; public class Main \{ public static void main(String[] args) \{ ArrayUnboundedQueue drinks = new ArrayUnboundedQueue > (); ArrayUnboundedQueue fruits = new ArrayUnboundedQueue > (); ArrayUnboundedQueue notClassified = new ArrayUnboundedQueue >(); Scanner scanner = new Scanner (System.in); while (true) \{ System.out.print ("Enter a string formatted as D drinkname or F fruitname: "); String input = scanner.nextLine(); if (input. equals ("E end")) \{ break; \} if (input.startswith(" ")) \{ drinks. enqueue(input. substring(2)); \} else if (input.startswith("F ")) \{ fruits.enqueue (input.substring (2)); \} else \{ notClassified. enqueue (input); \} \} System, out. println ("Drink:" tstring,join (" " drinks))i System, out println ("Frujt "string.join(" e fruits) i i \} \} kage queue

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

How can government agencies help businesses?

Answered: 1 week ago