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
Mylab Programming With Pearson Etext -- Access Code Card -- For C++ How To Program (early Objects Version)
- PLEASE HELP (AGAIN): Perhaps I am simply in the dark about how to use .h files. I have no file to add. These are the instructions: 1. Write a class to represent Roman numerals. a. The class should have two constructors.: (1) A default constructor (2) A constructor that takes a string as a paramter (i.e., string representing a roman numeral) b. This class should have the following member functions, in addition to the above constructors: (1) set - sets the member variable to the values in the function parameter (2) print - print the converted integer value (3) convert the roman number string to a positive integer (4) print the roman number string c. This class should have two PRIVATE member variables: (1) string to hold the roman numeral string (2) integer to hold the converted value 3. Create: a. a class definition file (*.h) b. a class implementation file (*.cpp) c. a client program to test your class (*.cpp) d. a project for these code files 4. The client program…arrow_forwardNote: Write a c++ code and also include the header file and main function also. 1. Define a class Container for storing integer values, regardless of the sequence andduplication checks. Your class should consist of the member variables.int * values;// A pointer to an int . This member points to the dynamicallyallocated array of integers (which you will be allocating in constructor).int capacity;// An integer that shows total capacity of your containerint counter;// A counter variable which increments upon every insertionoperation; shows total number of elements inserted yet in container 2. You would need a parameterized constructor with single parameter int c; i.e. itinitializes the capacity variable, showing the total capacity of the container, and alsoallocating memory to array. Set the value of counter to 0.Container(int c)Also a copy constructor Container(Container &copy)Implement the functions mentioned below: 3. Function bool isFull( ), to check if the counter has reached…arrow_forwardAnswer this iin C++: Given main(), complete the Calculator class (in files Calculator.h and Calculator.cpp) that emulates basic functions of a calculator: add, subtract, multiple, divide, and clear. The class has one private data member called value for the calculator's current value. Implement the following constructor and public member functions as listed below: Calculator() - default constructor to set the data member to 0.0 void Add(double val) - add the parameter to the data member void Subtract(double val) - subtract the parameter from the data member void Multiply(double val) - multiply the data member by the parameter void Divide(double val) - divide the data member by the parameter void Clear( ) - set the data member to 0.0 double GetValue( ) - return the data member Given two double input values num1 and num2, the program outputs the following values: The initial value of the data member, value The value after adding num1 The value after multiplying by 3 The value after…arrow_forward
- Answer this in C++: Given main(), complete the Calculator class (in files Calculator.h and Calculator.cpp) that emulates basic functions of a calculator: add, subtract, multiple, divide, and clear. The class has one private data member called value for the calculator's current value. Implement the following constructor and public member functions as listed below: Calculator() - default constructor to set the data member to 0.0 void Add(double val) - add the parameter to the data member void Subtract(double val) - subtract the parameter from the data member void Multiply(double val) - multiply the data member by the parameter void Divide(double val) - divide the data member by the parameter void Clear( ) - set the data member to 0.0 double GetValue( ) - return the data member Given two double input values num1 and num2, the program outputs the following values: The initial value of the data member, value The value after adding num1 The value after multiplying by 3 The value after…arrow_forwardHello. I'm trying to make a C++ program practices with classes and OOP with dates, using three files: main.cpp, Date.cpp, and Date.h. I'm getting errors in main.pp for undefined references and in Date.cpp. there is alse an error for undefined reference Requirements Date.h will contain the class declaration. The following is required in the class declaration: The private attributes are the month, day, and year. The public member functions are PrintDate, SetDate, and NextDate The default constructor should initialize all data to the value 0. NextDate should still return a new Date object with the next day's information. This function needs to be completed (For this, just assume Feb has 29 days all the time even though it is not true.) Date.cpp will contain the implementation of all member functions and the constructor main.cpp* will need to be updated to use the member functions. Example: SetDate(today,2,13,2016); // today.month = 2; // today.day = 13; //…arrow_forwardProgramming Assignment Containers are used to store objects of the same type and provide operations with which these objects can be managed. These operations include object insertion, deletion, and retrieval. Memory is allocated for containers dynamically at runtime. Containers thus provide a safe and easy way to manage collections of objects. The C++ standard library provides various class templates for container management in the Containers Library. These classes can be categorized as follows: Sequential containers, where the objects are arranged sequentially and access to an object can either be direct or sequential. Associative containers, where the objects are generally organized and managed in a tree structure and can be referenced using keys. Sequential Containers Sequential containers are distinguished by the operations defined for them, which are either generic or restricted. Restricted operations, such as appending at the end of a container, have constant…arrow_forward
- 1) Give detailed answer: A)What are the pointers and dynamic arrays? How to declare them? b)What is vector? What is array? What are the difference in between them? c)What is Container class? How do we declare one?arrow_forwardPlease help me explain the below. They are on classes and objects - Data Encapsulation Definition - What does a class comprise of? - What are the different access specifiers and the difference between them - What are accessor and mutator methods - How do you create an object for a class - What is data hiding? - What is a constructor used for? - How do you write a constructor for a class? - What is function overloading and constructor overloading? - What is the use of the this keyword? - Passing objects to methods - What is the toString Method used for?arrow_forwardKindly Solve this C++ question as per the instructions. Thank you for your help! Instructions: 1- Put the class definition in Flight.h and the implementation of the constructors and functions in Flight.cpp Implement the Flight.h and Flight.cpp so that class Flight contains: 4 private instance variables: Name of data type string, which describe the three electric vehicle charger types (AC975, DL521, and AC863). Destination of data type string that shows the final destination of that flight. Hour and Minute of data type int that show the departure time. A default constructor which sets all of the numeric instance variables to zero and the String instance variables to null. A constructor with 4 parameters that sets the 4 instance variables to the corresponding values passed. Implement an accessor method for each information (Flight name, Flight destination, and Flight Time) that will return the value of the instance variable. For example, the getX() method for the instance variables…arrow_forward
- ABC Bank needs to store the information of all the users. For a user, the information that the bank holds is the user's name, username, password, contact number. Read this data from the console and store it in a file named "example.txt". Write a C++ program to read inputs from the console and write the user details into a file as the comma-separated values. Strictly adhere to the Object-Oriented specifications given in the problem statement. All class names, member variable names, and function names should be the same as specified in the problem statement. File names used should be the same as mentioned in the problem description. The class named User has the following private member variables Data typeVariable namestringnamestringusernamestringpasswordstringcontactnumber Define the following member function in the class UserBO. Method nameDescription void writeUserdetails(ofstream &file,User obj)…arrow_forwardABC Bank needs to store the information of all the users. For a user, the information that the bank holds is the user's name, username, password, contact number. Read this data from the console and store it in a file named "example.txt".Write a C++ program to read inputs from the console and write the user details into a file as the comma-separated values.Strictly adhere to the Object-Oriented specifications given in the problem statement. All class names, member variable names, and function names should be the same as specified in the problem statement. File names used should be the same as mentioned in the problem description.The class named User has the following private member variables Data type Variable name string name string username string password string contactnumber Define the following member function in the class UserBO. Method name Description void writeUserdetails(ofstream &file,User obj)…arrow_forwardWAP to read the class object of student info such as name, age and rollno from the keyboard and to store them on a specified file using read() and write() functions Again the same file is opened for reading and displaying the contents of the file on the screen. File Handling In C++arrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning