Fill in the blanks in each of the following statements:
a) The three styles of container classes are first-class containers, _______ and near containers.
b) Containers are divided into four major categories—sequence containers, ordered associative containers, _____ and container adapters.
c) The Standard Library container adapter most closely associated with the first-in, first- out (FIFO) insertion-and-removal discipline is the ______.
d) Built-in arrays, bitsets and valarrays are all _________ containers.
e) A(n) ______ constructor (C++11) moves the contents of an existing container of the same type into a new container, without the overhead of copying each element of the argument container.
f) The _______ container member function returns the number of elements currently in the container.
g) The _______ container member function returns true if the contents of the first container are not equal to the contents of the second; otherwise, returns false.
h) We use iterators with sequences—these be input sequences or output sequences, or they can be _________.
i) The Standard Library
j) Applications with frequent insertions and deletions in the middle and/or at the extremes of a container normally use a(n) ________.
k) Function __________ is available in every first-class container (except forward_list) and
it returns the number of elements currently stored in the container.
l) It can be wasteful to double a
m) As of C++11, you can ask a vector or deque to return unneeded memory to the system by calling member function ____.
n) The associative containers provide direct access to store and retrieve elements via keys (often called search keys). The ordered associative containers are multi set, set, ___ and ___.
o) Classes ____ and ____ provide operations for manipulating sets of values where the values are the keys—there is not a separate value associated with each key.
p) We use C++11’s auto keyword to ____.
q) A multimap is implemented to efficiently locate all values paired with a given ____.
r) The Standard Library container adapters are stack, queue and _____.
Want to see the full answer?
Check out a sample textbook solutionChapter 15 Solutions
C++ How to Program (10th Edition)
- Language : C++ Subject : OOP Suppose we have a class Rectangle which has two data members, length and width. In addition, there should be a static variable, namely allRectanglesTotalArea which stores the area of all the Rectangles created. Furthermore, there should be a function named calcRectangleArea() which calculates the area of rectangle and adds it to the allRectanglesTotalArea. Write a static function nameddisplayAllRectanglesTotalArea()which displays the value of allRectanglesTotalArea. The main function of the program should look like the following. intmain() { Rectangle r1(5.0,4.0); r1.calcRectangleArea(); Rectangle r2(2.5,4.0); r2.calcRectangleArea(); Rectangle::displayAllRectanglesTotalArea(); return 0; }arrow_forwardThis laboratory work covers the following concepts in C++ programming language: class declaration (access specifiers: public, private) data members, member functions constructors, destructor Create a Win32 Console application and an empty C++ source file in Visual Studio IDE to be able to start typing programs, Task-1: Write a C++ program that implements the geometric shape "rectangle" as an object. For that, you should decide the data members that represent the object first, and then you should write the necessary member functions for the correct operation of the class. The class declaration should also include at least one constructor function. Remember that, for a rectangle, we can calculate the area, circumference, and diagonal length. You should define all member functions within the class declaration. v Test all member functions written! V Try to define member functions outside the class declaration. Task-2: Consider the C++ program written in part-1 and rewrite it separating the…arrow_forwardCS 232 - Lab #6 - Pets Ahoy! We have recently been discussing the creation of classes in C++. Recall that classes serve as a "template" for the objects in our program, and that when we instantiate a class, we are creating an object which models the properties and behaviors of real-world objects. For this assignment, design and implement a parent class to represent a pet and several small sub-classes of the most common pets for cats, dogs, birds, and turtles. Each pet object is characterized by a type, name, birth date, owner, weight, sex, speak, and color. The variable data type for the type variable is a string that identifies the type of pet as a "dog", "cat", "bird", "turtle". The name is a string that identifies the name of the pet. The owner variable is a string that designates the name of the pet's owner. The weight specifies the pet's weight in pounds and is a double value. The speak variable is a string that holds an onomatopoeia of the sound the animal makes when it “speaks”…arrow_forward
- In c++ Please Help. Please do not use chat GPTarrow_forwardOOP C++ Problem This task needs to be done through OOP C++ Object-Oriented Programming in C++ Project Consider the following a file (movies.txt) with the following list of movies (comma separated list). SNO, Name, NoOfPeopleLiked 1, The Shawshank Redemption, 77 2, The Godfather, 20 3, Into The Wild, 35 4, The Dark Knight, 55 5, 12 Angry Men, 44 6, Schindler's List, 33 7, The Lord of the Rings: The Return of the King, 25 8, Pulp Fiction, 23 9, The Good, the Bad and the Ugly, 32 10, The Lord of the Rings: The Fellowship of the Ring, 56 OUTPUT SHOULD BE LIKE THIS Enter the name of movie you like: Into The Wild The movie is found in the database. It is already the favourite movie of 35 people. Do you like it as well (y/n)? y Do you want to look for another movie (y/n)? y Enter the name of movie you like: In Time The movies is not found in the database. Do you want to add it to the list of movies (y/n)? y…arrow_forwardReadme.md: Stars(C++) This lab exercise will practice creating objects with constructors and destructors and demonstrate when constructors and destructors are called. Star Class Create a class, Star. A Star object has two member variables: its name, and a solar radius. This class should have a constructor which takes a std::string, the name of the star, and a double, the solar radius of the star. In the constructor, the Star class should print to the terminal that the star was born. For example, if you create a Star as follows: Star my_star("Saiph", 22.2); Then the constructor should print: The star Saiph was born. In the destructor, the Star class should print to the terminal that the star was destroyed, along with the number of times the volume of the sun that that star was, formatted to two decimal places. Hint: use the following line to set the precision to 2 decimal places: std::cout << std::fixed << std::setprecision(2); For example, when my_star above has its…arrow_forward
- C++HurdleGame The HurdleGame class contains all the functions invoked as a result of a user action (i.e. when a user presses a key on the Hurdle Frontend, one of the functions in HurdleGame will be called. A HurdleGame object comprises a HurdleWords object (which stores all valid guesses and valid Hurdles), and a HurdleState object, which stores and tracks all the game states. Any action should update the HurdleState object.Each function in HurdleGame is called as a result of a user action on the Hurdle Frontend. To understand this, please read the Hurdle Backend API section below before implementing. You are responsible for implementing each of the functions below. LetterEntered ● Called by the Hurdle frontend when the user enters a letter. ● Hint: when a user enters a letter, how should the underlying HurdleState be modified to reflect the change resulting from that key press? WordSubmitted ● Called by the Hurdle front end when the user submits a guess by pressing enter. ● Hint: when…arrow_forwardPlease Solve the following Question using C++ Programming Language.arrow_forwardhelp with c++....paste indented code plzzarrow_forward
- Language: C++ Subject: OOP Task:You have to write a program to store information of university students. There can be many students in university, so you can make a Student class and objects of class Student to store information. The university is interested in storing information about student’s name, enrollment, department, class, CGPA and gender. You can store this information as data member values for each object. But as you already know you cannot directly access data members of a class, so you need to make member functions to access data members. You can make as many member functions as you want. There are no restrictions. The University is interested in knowing the student’sname with highest CGPA in a specific class. For example if you entered information of 10 students from class BSIT 2 and information of 5 students from class BSIT 3, and it is asked to find name of student with highest CGPA in BSIT 2 then your program must be able to find details of highest CGPA student from…arrow_forwardLanguage: C++ Create a class called publication that stores the title (char array) and price (float) of a publication. From this class derive two classes: book, which adds a page count (int) and tape, which adds a playing time in minutes (float). Each of the three classes should have a getdata() function to get its data from the user using input from the keyboard and a putdata() function to display the data.Write a main function that creates an array of pointers to publication. In a loop, ask the user for data about a particular type of book or tape to hold data. Put the pointer to the object in the array. When the user has finished entering data for all the books and tapes, display the resulting data for all the books and tapes entered, using a for loop and a single statement such as: pubarr[j] -> putdata(); To display the data from each object in the array.arrow_forwardm6 C++ Question: Make an execution chart like the example below for the code provided. Example chart: An execution chart is a text version of the hierarchy. Indentation is used to indicate thesublevels or calls inside a call. It also contains the data exchange between the components asdesignated in the hierarchy chart. Given below is the execution chart that corresponds to thehierarchy chart of the property tax calculation program1.0 Main()2.0 CalculatePropertyTax()3.0 displayMessage( input string messageToDisplay)3.1 return double getHomeValue()3.2 return boolean checkHomeValue()3.3 return double applyPropertyTax(input double homeValue)3.4 displayPropertyTax(input homeValue)3.5 return Boolean queryMoreData()4.0 displayMessage(input string messageToDisplay)4.1 return char getYesNo()4.2 return char convertCase(input char)3.6 displayErrorMessage() More exlanation: example: 1.0 means it's of depth 1, line 0 then 2.0 means it's one call inside a function (aka it's inside another function)…arrow_forward
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr