Use C++ Programming Language.   Objective  Define a circular buffer data structure and test it. Problem Description: A circular buffer (also called a circular queue) is circular list of nodes where data items are added on one end of the buffer and removed from the other end. Because the nodes form a circular list, the list has no end or beginning: the tail node points to the head node, creating a ring of nodes.   You may think of the nodes as containers or slots that are all initially empty but can be assigned a value in their data field info.   Every time a new data item is inserted (inserting to a buffer is often referred as Writing), one slot is filled and the buffer has one less empty slot. Every time a data item is removed (referred to as Reading), the buffer has one more empty slot.  Since the list has no beginning and no end, a pointer (writeIndex) is used to mark the next empty slot to write to and a second pointer (readIndex) is used to mark the next node to read from.  The readIndex/writeIndex must be properly updated with each read/write operation. The read and write operations must also check the buffer status (empty/full) before reading/writing.  Define a class that that implements the circular buffer data structure as described above: Create a program to test your implementation of class circularBuffer. Use instructions listed in the comments in file testCircularBuffer.cpp to test your implementation. Recommendation:  You should implement and test class circularBuffer incrementally: start by creating function stubs for all class methods, then implement and test each method one by one. Always start by implementing the class constructor.  Deliverables: In a text file, clearly indicate the list of functions of class circularBuffer you implemented successfully. Submit the text file. Submit a copy of your implementation of class cicularBuffer (cicularBuffer.h) and testCircularBuffer.cpp Submit screenshots of your program runs using the test procedure outlined in testCircularBuffer.cpp to prove your work.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Use C++ Programming Language.

 

Objective

 Define a circular buffer data structure and test it.

Problem Description:

A circular buffer (also called a circular queue) is circular list of nodes where data items are added on one end of the buffer and removed from the other end. Because the nodes form a circular list, the list has no end or beginning: the tail node points to the head node, creating a ring of nodes.   You may think of the nodes as containers or slots that are all initially empty but can be assigned a value in their data field info.   Every time a new data item is inserted (inserting to a buffer is often referred as Writing), one slot is filled and the buffer has one less empty slot. Every time a data item is removed (referred to as Reading), the buffer has one more empty slot.  Since the list has no beginning and no end, a pointer (writeIndex) is used to mark the next empty slot to write to and a second pointer (readIndex) is used to mark the next node to read from.  The readIndex/writeIndex must be properly updated with each read/write operation. The read and write operations must also check the buffer status (empty/full) before reading/writing. 

Define a class that that implements the circular buffer data structure as described above:

Create a program to test your implementation of class circularBuffer. Use instructions listed in the comments in file testCircularBuffer.cpp to test your implementation.

Recommendation:  You should implement and test class circularBuffer incrementally: start by creating function stubs for all class methods, then implement and test each method one by one. Always start by implementing the class constructor. 

Deliverables:

  1. In a text file, clearly indicate the list of functions of class circularBuffer you implemented successfully. Submit the text file.
  2. Submit a copy of your implementation of class cicularBuffer (cicularBuffer.h) and testCircularBuffer.cpp
  3. Submit screenshots of your program runs using the test procedure outlined in testCircularBuffer.cpp to prove your work.

 

 

 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY