Create queue class should have the following methods

Assignment Help Basic Computer Science
Reference no: EM13306876

create queue class should have the following methods:

void enqueue(T) - add data to the back of the queue
T dequeue() - return the data from the front of the queue and remove it from the queue
int count() - return how many items are in the queue
bool empty() - return true if the queue is empty otherwise return false
Here is what your main program should be:

// put your includes, and comments here
void main()
{
Queue<string> stringQueue;
stringQueue.enqueue(string("Hello"));
Queue<int> intQueue;
Queue<double> doubleQueue;
for(int i=2;i<=22;i+=4){
intQueue.enqueue(i);
doubleQueue.enqueue(i+0.5);
}
stringQueue.enqueue(string("World"));
while (!stringQueue.empty())
cout << stringQueue.dequeue() << endl;
while (!intQueue.empty())
cout << intQueue.dequeue() << endl;
while (!doubleQueue.empty())
cout << doubleQueue.dequeue() << endl;
}

 

Reference no: EM13306876

Questions Cloud

Estimate the power the device can produce at a wind speed : The U.S. Department of Energy (DOE) constructed a Darrieus vertical-axis wind turbine in Sandia, New Mexico. The machine is 60.0-ft tall and 30.0-ft in diameter, and swept an area of 1200 ft 2.
Compute the wavelength of the scattered wave : A photon whose energy is 2.6 Ã- 10âˆ'14 J is scattered off an electron at an angle of 56â. What is the wavelength of the scattered wave
Calculate rate at which entropies of 2 reservoirs change : A completely reversible air conditioner provides 21,000Btu/h of cooling for a space maintained at 81degF while rejecting heat to the environmental air at 91degF.
Calculate the scattering angle : X-rays are scattered from electrons in a carbon target. The measured wavelength shift is 0.00099 nm. Calculate the scattering angle
Create queue class should have the following methods : create queue class should have the following methods:
Determine the image distance from the lens : A magnifying lens with a focal length of 5 cm is held 4 cm from an object that is 1cm tall. Find the image distance from the lens
What is the heat rejection for the condenser in btu per h : Consider a small simple Rankine Power cycle which produces 600kW power from an electric generator with an efficiency of 95%. The steam leaves the boiler at 1250psia as superheated steam and leaves the turbine at 2 psia with a quality of 90%.
Calculate and output the mean and median of collected data : Design a program that will allow some number of grades (up to a max of 100) to be input by the user. After the data has been collected, your program should calculate and output the mean and median of the collected data, as well as the sorted grade..
Store the quotient in a word-size variable called result : Show how to perform 77 / 3 in the HCS12. Store the quotient in a WORD-size variable called result, and the remainder in a WORD-size variable called remainder.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

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