Question

Que of Strings lab in C++

This is Part 1Queue of Strings November 25, 2018 at 11:59 pm Instructions queueOfStrings.cpp StringQueue.h There are two struct definitions in StringQueue.h, but they are incomplete. Your task for this exercise is to complete them. It is just a basic queue data structure, but instead of int or long, the queue stores string elements. As usual, just make it so that the file queueOrstrings.cpp compiles and runs correctly

queOfStrings.cpp file code

StringQue.h file code

Part 2

Please fully answer both parts in C++ thank you.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

If you post more than 1 question, as per HomeworkLib guidelines we have to solve only first question.

Ques 1.

#ifndef Queue_h

#define Queue_h

#include<iostream>

#include<string>

using namespace std;

struct Link{

    // store the value of the node

    string data;

   

    // point to the next element

    struct Link *next;

};

struct Queue{

    // point to first node in queue

    struct Link *front;

   

    // point to rear node in queue

    struct Link *rear;

};

#endif

Add a comment
Know the answer?
Add Answer to:
Que of Strings lab in C++ This is Part 1 queOfStrings.cpp file code StringQue.h file code...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Use basic C++ 3. A text file, superstars.txt, contains statistics on cricket players. For each player,...

    Use basic C++ 3. A text file, superstars.txt, contains statistics on cricket players. For each player, the file contains the player's first name, last name, number of matches played, total number of runs scored, number of times the player scored 100 runs in a match, and the number of wickets taken. The last row of data in the file contains the word "END" only. Some rows are shown below 30 11867 164 Chanderpaul Shivnarine 34 11912 130 Lara Brian 73...

  • In c++ show both .cpp and .hpp file for the class: class Task { private: //...

    In c++ show both .cpp and .hpp file for the class: class Task { private: // These three member variables store the basic information about a task string title; string location; // This pointer will point to a dynamically-allocated array // of THREE strings. Each element contains the name of a supply required for this task. // This should start out set to NULL. string * tags; // This integer stores the number of elements in the tags array. int...

  • Hi! it is c++ queue simulation please read the instructions, write codes, and explain the code...

    Hi! it is c++ queue simulation please read the instructions, write codes, and explain the code with comments. Thank you Transactions enter the system and are stored in a queue. Each transaction represents some work that needs to be accomplished. Servers exist which process transactions. Servers take transactions off the queue and process them. you’re building the simulation framework. The idea is that somebody would take your framework, and add the specifics for whatever type of system it was going...

  • Code in C++ Function Prototypes For the second part of the lab activity, you will be...

    Code in C++ Function Prototypes For the second part of the lab activity, you will be practicing writing function prototypes. Continue working on the same project from part A. First, rewrite the code so that you are using function prototypes for the functions getNumber.getMessage, and repeat. Remember that the prototypes go at the top of the file, followed by main, then the definitions of the three functions at the end. Second, you will be creating a new function (procedure) called...

  • The following code uses a Scanner object to read a text file called dogYears.txt. Notice that...

    The following code uses a Scanner object to read a text file called dogYears.txt. Notice that each line of this file contains a dog's name followed by an age. The program then outputs this data to the console. The output looks like this: Tippy 2 Rex 7 Desdemona 5 1. Your task is to use the Scanner methods that will initialize the variables name1, name2, name3, age1, age2, age3 so that the execution of the three println statements below will...

  • IN C# The fun for today is to build your own circular array to support a...

    IN C# The fun for today is to build your own circular array to support a queue. The challenge here is in adjusting your queueFront and queueRear markers (they are just integer array indices), and dealing with what happens when they wrap around the First/last element of the array. The tricky part here is worrying about the edge cases. There are only two methods you need to fix up addBack – this should correctly add an item at the rear...

  • Hi, I need some help finishing the last part of this Python 1 code. The last...

    Hi, I need some help finishing the last part of this Python 1 code. The last few functions are incomplete. Thank you. The instructions were: The program has three functions in it. I’ve written all of break_into_list_of_words()--DO NOT CHANGE THIS ONE. All it does is break the very long poem into a list of individual words. Some of what it's doing will not make much sense to you until we get to the strings chapter, and that's fine--that's part of...

  • Please use C Programming language (Not C++) 7.6 LAB*: Warm up: Online shopping cart (Part 1)...

    Please use C Programming language (Not C++) 7.6 LAB*: Warm up: Online shopping cart (Part 1) (1) Create three files to submit: • Item ToPurchase.h - Struct definition and related function declarations • Item ToPurchase.c-Related function definitions • main.c-main function Build the ItemToPurchase struct with the following specifications: • Data members (3 pts) • char itemName • int itemPrice • int itemQuantity • Related functions • MakeltemBlank0 (2 pts) Has a pointer to an item To Purchase parameter. Sets item's...

  • I need help with the following code... Instructions: This lab builds on the skills from Lab...

    I need help with the following code... Instructions: This lab builds on the skills from Lab 2c, in which you read data values from a file and kept a count of the number of invalid values. In this lab, your program will be using the same code to read each data entry from the file, but you will also save each value in an array named allMags after each is read in. When all values in the file have been...

  • C++ -- Event processing simulation using a transaction queue Hi! it is queue simulation please read...

    C++ -- Event processing simulation using a transaction queue Hi! it is queue simulation please read the instructions, write codes, and explain the code with comments. Thank you Transactions enter the system and are stored in a queue. Each transaction represents some work that needs to be accomplished. Servers exist which process transactions. Servers take transactions off the queue and process them. you’re building the simulation framework. The idea is that somebody would take your framework, and add the specifics...

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
ADVERTISEMENT