Simulate the biscuit pan with a computer program

Assignment Help Computer Engineering
Reference no: EM132188671

Work with the Stack data structure and explore the idea of first-in, last-out (FILO).

Imagine that you're visiting a local all-you-can-eat breakfast bar; among the many items on the bar is a pan of biscuits.

Your task is to simulate the biscuit pan with a computer program.

Note that when new biscuits are added to the pan, they're always added to the top (the worker just dumps new biscuits on top of the old biscuits); also note that whenever someone takes a biscuit to eat, they pick the top-most biscuit.

Thus we've got a stack (first-in, last-out) and the bottom-most biscuit is always the oldest. For sake of simplicity, imagine that the pan only allows you to select a "top" biscuit (i.e. you can't pick among many).

The task is to utilize a stack collection. Your program should allow the user to add a biscuit, remove a biscuit, and print the status of the stack. The stack should store the time in which the biscuit was added; and when a biscuit is removed, the program should display how long the biscuit "lived" in the pan (i.e. the difference from now to when it was added to the pan).

Important items to consider:

Don't allow the user to remove (pop) a biscuit if the pan is empty

Displaying the status of the stack should show how many biscuits are in the stack and the "age" of the topmost biscuit

Use the Stack class to make your job a LOT easier (otherwise, you must implement the stack class yourself).

To get the time in Java, import java.util.* and then make use of the Date class

Reference no: EM132188671

Questions Cloud

Display the total price of the hotel stay : You work for a local hotel chain and have been tasked with coding a program that calculates the cost of a user's hotel stay depending on room choices.
What factors would influence you : You work as one of five senior networking engineers in a large insurance company with 500 small offices located across the United States.
Create a class with instance methods withdraw : Each Class should have a unique account number and a current balance (use a static variable to store lastAccountNumber).
Study the variation in chicagos temperature : If the temperature never increased, then report that. Give a O(n log n) algorithm for this task.
Simulate the biscuit pan with a computer program : Imagine that you're visiting a local all-you-can-eat breakfast bar; among the many items on the bar is a pan of biscuits.
In your own words what is a data structure : Provide an example application for which a list is appropriate. Please be sure to provide details with your application.
Oral style of speaking and a written style of communicating : What are the key differences between an oral style of speaking and a written style of communicating?
What is the best way to learn the difference : What is the best way to learn the difference between high-context and low-context styles?
Achieve effective intercultural communication : Identify three skills that are necessary to achieve effective intercultural communication as a provider in a healthcare setting

Reviews

Write a Review

Computer Engineering Questions & Answers

  This will be a 3 page double spaced analysis and position

this will be a 3 page double spaced analysis and position paper. the paper will be on what will be the most impacting

  Questionset up a systems analysis report detailing aces

questionset up a systems analysis report detailing aces problem and a system solution that can be implemented using pc

  Questionenlarge the size of the array to 25 driver will

questionenlarge the size of the array to 25. driver will start with 10 objects in it other than has provision for up to

  Algorithm and flow chart

Write down an algorithm and develop a flow chart in order to determine all people who have computer experience and at least five years of company service.

  What is an important port near you what comes into this

the paper is to be at leastnbsp4 pages excluding the title page and bibliography. apa is to be used in citations.

  How does hardware support time management in the os

How does hardware support the dual mode process (i.e., controlling between user mode and kernel mode)?

  Discuss the subsequent questions relative to compilersa

discuss the subsequent questions relative to compilersa. which phase of a compiler could give you a syntax error? b.

  Analyze the time complexity of parallel algorithms

CSNB594 - Parallel Computing - Design parallel code to solve a given problem, determine computational bottlenecks and optimize the performance of the code

  Create a visual logic file to execute the task

Create a Visual Logic file to execute the task. Create an Excel Macro to execute that accomplishes the same calculation task as the Visual Logic file.

  Why are gaap and gaas important to the it auditor

Why are GAAP and GAAS important to the IT auditor? What and where are the resources available to train auditors, especially IT auditors?

  Question1 describe software construction in one paragraph2

question1. describe software construction in one paragraph.2. name and describe the five components that make up the

  Develop a full contingency plan for the organization

Develop a full contingency plan for the organization. Include all subordinate functions / sub plans, including BIA, IRP, DRP, and BCP efforts.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd