Question

Code a queue data structure to store the Grocery, Meat, and Produce object instances created during program execution. Transform your code to use the queue instead of the array. It is recommended to create a new class file, however, to retain the prior version of your course project. You can copy your code from the prior module into your new class file to get started. Leverage your file-processing code from the prior Module. Include appropriate package import declarations as needed. Output: to the console while executing the program: Use System.out.printf to echo back to the user the data they input once validated. Other console output as needed. Output: Save to the .txt file: Headings: A greeting. Your Name. Your Class, Module/Week, and Assignment. Date/Time stamps. Output generated by polymorphic calls to the toString() method during queue processing. After the user has signaled the termination of input and prior to exiting the program, process the queue by serving its contents and writing them to the output .txt file using a polymorphic call to the toString() method. The final totals and average cost.

Grocery - name :String - quantity int cost do ub le -extendedCost double groceryObjectID: int groceryobiectCounter: int totalQuantity: int ExtendedC ub <cconstructor>> Grocery() <<constructor>> Grocery(name: String, quantity : int, cost double) + setName(name: String): vo id +getName String setQuantity(quantity: int) : void +getQuantity: int + setCost(cost double): void + getCost() double + getExtendedCost() : dou ble +getGroceryOb jectlDO int +getTotalQu antity() int +getTotalExtendedCost :double +getTotalsAndAverage(): String +toStringl): String Meat Produce - co okingTemp: int - co okin gTime String - cooked: boolean <<constructor>> Meat <econstructor>> Meat(cookingTemp: int, cookingTime: String, cooked: boolean) + setCookingTemp(cooking Tem p: int) void +getCookingTemp): int + setCookingTime(cooking Time: Strin g) void +getCookingTime(): String + setCooked(cooked: boolean) void +getCooked0 boolean toString0 String - needsPeeling boolean - peeled: boolearn <cconstructor>> Produce( <<constructor>> Produce(need sPeeling: boolean, peeled: boolean) + setNeedsPeeling(needsPeeling: boolean) + getNeedsPeeling() boolean + setPeeled(peeled: boolean) +getPeeled boolean +toStringl): String

0 0
Add a comment Improve this question Transcribed image text
Request Professional Answer

Request Answer!

We need at least 10 more requests to produce the answer.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the answer will be notified once they are available.
Know the answer?
Add Answer to:
Code a queue data structure to store the Grocery, Meat, and Produce object instances created during...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
  • Use java and continue stage 2 and 3 stage 1 code public abstract class BabyItem { protected String name;...

    Use java and continue stage 2 and 3 stage 1 code public abstract class BabyItem { protected String name; public BabyItem() { name=""; } public BabyItem(String name) { this.name = name; } public String getName() { return name; } public void setName(String name) { } public abstract double getCost(); } ======================================================================================== public class BabyFood extends BabyItem { private int numberOfJars; private double pricePerDozen; public BabyFood() { super(); numberOfJars = 0; pricePerDozen = 0; } public BabyFood(int numberOfJars, double pricePerDozen) {...

  • This project will allow you to write a program to get more practice with the stack...

    This project will allow you to write a program to get more practice with the stack and queue data structures, as well as more practice with object-oriented ideas that we explored in the previous projects. In this assignment you will be writing a simulation of an order-fulfillment system for a company like Amazon.com. These companies take orders for products and ship them to customers based on what they have in inventory. For this assignment you will be performing a scaled-back...

  • C++ Retailltem.h, Retailltem.cpp, Store.h, Store.cpp, and Driver.cpp. Description: Write a set of programs that holds data...

    C++ Retailltem.h, Retailltem.cpp, Store.h, Store.cpp, and Driver.cpp. Description: Write a set of programs that holds data about items in a retail store. Your submission should include 5 files, Retailltem.b, Retailltem.cpp, Store, Store.cpp, and Driver.cpp 1. Retailltem class: The class should have three member variables • description (a string, represent the item's name. A name contains space) quantity (an int, represent how many current available) price (a double, item's price) Member Functions Constructor with default argument get Description getQuantity getPrice setDescription...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT