Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

java Instructions You will be given a grocery list, followed by a sequence of items that have already been purchased. You are going to determine

java
image text in transcribed
image text in transcribed
image text in transcribed
Instructions You will be given a grocery list, followed by a sequence of items that have already been purchased. You are going to determine which iterns remain on the the list and output them so that you know what to buy You will be give an integer n that describes how many items are on the original grocery list. Following that you will be given a list of n grocery list items strings that you need to buy. After your grocery list is complete, you will receive a list of items that had already been purchased for each of these items, if it matches any item on your grocery list you can mark that item as purchased. You will know that you are at the end of the list of iters already purchased when you receive the string "DONE". At that point, you will output a list of items left to buy teach item on its own line]. Write the body of the program Details Input The program reads the following: an integer, n, defining the length of the original grocery list . strings that make up the grocery list a list of items that had already been purchased (strings the string "DONE", marking the end of all required input Processing Determine which items on the grocery list have already been purchased Output Output the tems from the grocery list that remain to be purchased all items from the original grocery items that were not included in the list of items already purchased. Each grocery item must be printed on its own tine. The text must be terminated by a new line character Sample input/output Sample input Sample output 4 apples bananas carrots eggplant carrots DONE apples bananas eggplant import java.util.*; public class POD { public static void main(String[] args) { //Instantiate new scanner to read from the console. Scanner in = new Scanner( System.in); //PLEASE START YOUR WORK HERE //PLEASE END YOUR WORK HERE } }|

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

=+ What may change?

Answered: 1 week ago

Question

Provide examples of KPIs in Human Capital Management.

Answered: 1 week ago

Question

What are OLAP Cubes?

Answered: 1 week ago