QUESTION 2 Description: In your coding assignments you had to create a stack (twice). A stack...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
QUESTION 2 Description: In your coding assignments you had to create a stack (twice). A stack is a LIFO queue (last in, first out). Now create a FIFO "stack" (first in, first out) conforming to all the definitions of a stack except "pop" will pull data from the "bottom," not the "top." In other words, push will still push to the "top" but pull will pull from the "bottom." Similarly, peek will return the value on the "bottom." Specifications: Make a complete and properly architected, loosely-coupled "FIFO" class as discussed in lecture and notes, and conforming to all best practices. • Use a linked list approach to implement the queue, using the same "node" and "data" struct from your coding assignments. You can use a singly or doubly linked list. You are free to use a tail pointer in addition to the head pointer, your choice. • Make all the following methods for your FIFO class (it's up to you to figure out the parameters and return values): o push() o pull() ● ● O O ● peek() isEmpty() Make a main.cpp/main.h to test your queue. Make all appropriate, complete, and exhaustive tests to prove your object works. • Turn in only 4 files, main.cpp, main.h, queue.cpp, queue.h. Everything your program needs MUST be in those four files and ONLY those four files with those exact filenames. Hint: Although you may not have more than one class per set of h/cpp file, you may include supporting structs in your class header file. • Your code will be graded no different than any normal homework submission and must conform to all class submission guidelines. • Your code MUST compile with ONLY the files you submit, nothing more, nothing less. If your code does not compile at the command line with the standard compile command given in class there will be a significant grade penalty, up to and including a grade of 0. You will be graded based on all best practice guidelines presented in class. Hint: This is very simple to implement, do not over complicate it. "push" will always add to the tail. "pull" will always pull from the head. Submission: When you are ready to submit, place your 4 files in a single zip file, attach it to this question and upload it. Your zip file must contain ONLY those 4 files, no other files, no project or IDE files, no Mac OS files, and no directories including no top level directory). Inclusion of any other files/directories will incur an automatic 5% penalty. Mac people, you cannot use the built in zip utility because it will add extra files you cannot see, but Linux can (you are graded on Linux). Use the command line or a 3rd party zip utility to zip. Double check your zip files before submitting! 50 po QUESTION 2 Description: In your coding assignments you had to create a stack (twice). A stack is a LIFO queue (last in, first out). Now create a FIFO "stack" (first in, first out) conforming to all the definitions of a stack except "pop" will pull data from the "bottom," not the "top." In other words, push will still push to the "top" but pull will pull from the "bottom." Similarly, peek will return the value on the "bottom." Specifications: Make a complete and properly architected, loosely-coupled "FIFO" class as discussed in lecture and notes, and conforming to all best practices. • Use a linked list approach to implement the queue, using the same "node" and "data" struct from your coding assignments. You can use a singly or doubly linked list. You are free to use a tail pointer in addition to the head pointer, your choice. • Make all the following methods for your FIFO class (it's up to you to figure out the parameters and return values): o push() o pull() ● ● O O ● peek() isEmpty() Make a main.cpp/main.h to test your queue. Make all appropriate, complete, and exhaustive tests to prove your object works. • Turn in only 4 files, main.cpp, main.h, queue.cpp, queue.h. Everything your program needs MUST be in those four files and ONLY those four files with those exact filenames. Hint: Although you may not have more than one class per set of h/cpp file, you may include supporting structs in your class header file. • Your code will be graded no different than any normal homework submission and must conform to all class submission guidelines. • Your code MUST compile with ONLY the files you submit, nothing more, nothing less. If your code does not compile at the command line with the standard compile command given in class there will be a significant grade penalty, up to and including a grade of 0. You will be graded based on all best practice guidelines presented in class. Hint: This is very simple to implement, do not over complicate it. "push" will always add to the tail. "pull" will always pull from the head. Submission: When you are ready to submit, place your 4 files in a single zip file, attach it to this question and upload it. Your zip file must contain ONLY those 4 files, no other files, no project or IDE files, no Mac OS files, and no directories including no top level directory). Inclusion of any other files/directories will incur an automatic 5% penalty. Mac people, you cannot use the built in zip utility because it will add extra files you cannot see, but Linux can (you are graded on Linux). Use the command line or a 3rd party zip utility to zip. Double check your zip files before submitting! 50 po
Expert Answer:
Answer rating: 100% (QA)
mainh ifndef FIFOMAINH define FIFOMAINH define LOWERBOUND 1 define TESTVALUE 1000 define MULTIPLIER 20 define TESTVALUE3 VALIDSTACKSIZE 1000 include cout endl include functionsh include fifoh using st... View the full answer
Related Book For
Taxes And Business Strategy A Planning Approach
ISBN: 9780132752671
5th Edition
Authors: Myron Scholes, Mark Wolfson, Merle Erickson, Michelle Hanlon
Posted Date:
Students also viewed these programming questions
-
Design a Java class that represents a cache with a fixed size. It should support operations like add, retrieve, and remove, and it should evict the least recently used item when it reaches capacity.
-
A company received cash from a customer. It debited the Cash account. Name three credit accounts that the company might have used to record a cash receipt from a customer. Describe the circumstances...
-
(a) Use the rational zero test to find any rational zeros of the polynomial f(x). (b) Write the complete factored form of f(x). f(x) = 2x + x 19x - 9x + 9 -
-
A university pumps its water from wells located on campus. The falling water table has caused pumping costs to increase, the quantity of water available to decrease, and the quality of water to...
-
Planning and control decisions. Conner Company makes and sells brooms and mops. It takes the following actions, not necessarily in the order given below. For each action (ae below,) state whether it...
-
es Initial investment Annual net income Expected life Salvage value Merrill's cost of capital $ 2,100,000 $ 200,000 8 years $ 210,000 Assume straight line depreciation method is used. Required: 10 1....
-
MS sports manufacturing (Pvt) Ltd has purchase a machine during the year May 2023. Following is the transaction related to the machine occurred. 1. List price Rs. 1,500,000 2. Sales tax 18% 3. Custom...
-
How do environmental factors, such as geographic location, community dynamics, and cultural heritage, shape the salience and expression of identity, and what strategies can be employed to promote...
-
Frank exchanges his apartment building ( FMV $ 4 , 5 5 5 , 0 0 0 ; AB $ 8 0 0 , 0 0 0 ) and for Nico sapartment building ( FMV $ 4 , 0 0 0 , 0 0 0 ; AB $ 8 0 0 , 0 0 0 ) and $ 5 5 5 , 0 0 0 cash....
-
A car battery with a 12 V emf and an internal resistance of 0.062 Q is being charged with a current of 51 A. Note that in this process, the battery is being charged. (a) What is the potential...
-
4. A runner accelerates to a velocity of 5.36 m/s due west in 3.00 s. His constant acceleration is 0.640 m/s, also directed due west. What was his velocity when he began accelerating? How far does...
-
The hot resistance of a flashlight bulb is 1.80, and it is run by a 1.46-V alkaline cell having a 0.100-2 internal resistance. (a) What current flows? A (b) Calculate the power supplied to the bulb. W
-
1.Consider the following notation: Let N be the number of persons to be admitted, K the set of short-listed applicants, M the set of all female applicants, R the set of all non-stanbul-region...
-
The graph of the sequence whose general term is an = n - 1 is which of the following? [8.1] A. B. TITTT 3-2-1 23.45 2.3.4
-
What role does the actuary play in deciding on whether the fund is overfunded or underfunded? How does this role affect dynamic tax-planning strategies for the pension fund?
-
What is organizational form arbitrage? Give an example of organizational form arbitrage that would create infinite wealth for a taxpayer. What conditions are necessary to prevent this from happening?
-
A corporation can invest $ 10,000 in preferred stock that pays a 6% dividend and does not appreciate in price. The corporation faces a 40% tax rate. Dividends from the stock are eligible for the 70%...
-
Role of controller, role of chief financial officer. George Jimenez is the controller at Balkin Electronics, a manufacturer of devices for the computer industry. The company may promote him to chief...
-
In the following, assume that all growth and discount rates are stated in real terms. 1. Assume the Eurozone inflation-adjusted average growth in capital stock is 3.0 percent per annum into...
-
Which conclusion presented by Ryan about the top-down approach and the bottom-up approach is most likely correct? A. Conclusion 1. B. Conclusion 2. C. Conclusion 3. Use the following information to...
Study smarter with the SolutionInn App