word into a deque<string>...

Linki


» Dzieci to nie książeczki do kolorowania. Nie da się wypełnić ich naszymi ulubionymi kolorami.
»
STRING VARIABLE CPEB 15 DS; STRING VARIABLE CPART1 15 DS; ...
»
Po wykonaniu instrukcji String arr[][] = new String [3][]; odnoœnik arr identyfikuje 3-elementow¹ tablicê odnoœników do tablic...
»
This could come into play if you want to separate a string based on more than one element...
»
the word English...
»
INDEED rzeczywiście, naprawdę WHAT DOES THE WORD "INDEED" MEAN, AND WHAT DO WE USE IT FOR ?/ The word "indeed" means "really", and we use it for emphasis...
»
wdając się w szczegóły zastosowania wspomnianej ‼zabawki", powiem tylko tyle, że jej działanie opierało się na przetwarzaniu przez procesor obrazu z...
»
– Wie˛c...
»
Na tej wieży albo raczej sali, królowie uciechy swoje miewali, kolacye jadali, tańce i różne odprawowali rekreacye, bo jest w ślicznym bardzo prospekcie 5: może z...
»
Zniszczona sosnowa podłoga, rozłupana w kilku miejscach...
»
bracią zakonną), to religia możeposłużyć nawet jako środek, dzięki któremuuzyskuje się spokój, prożen zgiełku i trudów pospolitszego rządzenia, i...

Dzieci to nie książeczki do kolorowania. Nie da się wypełnić ich naszymi ulubionymi kolorami.

Force all the words to lowercase, sort them,
remove all the duplicates and print the results.

12.
Write a program that finds all the words that are in common between two
input files, using set_intersection( ). Change it to show the words that are
not in common, using set_symmetric_difference( ).

13.
Create a program that, given an integer on the command line, creates a
“factorial table” of all the factorials up to and including the number on the
command line. To do this, write a generator to fill a vector<int> , then use
partial_sum( ) with a standard function object.

14.
Modify CalcInventory.cpp so that it will find all the objects that have a
quantity that’s less than a certain amount. Provide this amount as a
command-line argument, and use copy_if( ) and bind2nd( ) to create the
collection of values less than the target value.

15.
Create template function objects that perform bitwise operations for & , |, ^
and ~. Test these with a bitset.

16.
Fill a vector<double> with numbers representing angles in radians. Using
function object composition, take the sine of all the elements in your vector
(see <cmath> ).

17.
Create a map which is a cosine table where the keys are the angles in
degrees and the values are the cosines. Use transform( ) with cos( ) (in
<cmath> ) to fill the table.

18.
Write a program to compare the speed of sorting a list using list::sort( ) vs.
using std::sort( ) (the STL algorithm version of sort( )). Hint: see the
timing examples in the previous chapter.

19.
Create and test a logical_xor function object template to implement a
logical exclusive- or.

20.
Create an STL-style algorithm transform_if( ) following the first form of
transform( ) which only performs transformations on objects that satisfy a
unary predicate.
Chapter 15: Multiple Inheritance
820

21.
Create an STL-style algorithm which is an overloaded version of
for_each( ) that follows the second form of transform( ) and takes two
input ranges so it can pass the objects of the second input range a to a
binary function which it applies to each object of the first range.

22.
Create a Matrix class which is made from a vector<vector<int> > . Provide it with a friend ostream& operator<<(ostream&, const Matrix&) to
display the matrix. Create the following using the STL algorithms where
possible (you may need to look up the mathematical meanings of the matrix
operations if you don’t remember them): operator+(const Matrix&, const
Matrix&) for Matrix addition, operator*(const Matrix&, const
vector<int>&) for multiplying a matrix by a vector, and operator*(const
Matrix&, const Matrix&) for matrix multiplication. Demonstrate each.

23.
Templatize the Matrix class and associated operations from the previous
example so they will work with any appropriate type.
Chapter 15: Multiple Inheritance
821
Part 3: Advanced
Topics
823
22: Multiple
inheritance
The basic concept of multiple inheritance (MI) sounds
simple enough.
[[[Notes:
1. Demo of use of MI, using Greenhouse example and different company’s greenhouse
controller equipment.
2. Introduce concept of interfaces; toys and “tuckable” interface
]]]
You create a new type by inheriting from more than one base class. The syntax is exactly
what you’d expect, and as long as the inheritance diagrams are simple, MI is simple as well.
However, MI can introduce a number of ambiguities and strange situations, which are covered
in this chapter. But first, it helps to get a perspective on the subject.
Perspective
Before C++, the most successful object-oriented language was Smalltalk. Smalltalk was
created from the ground up as an OO language. It is often referred to as pure, whereas C++, because it was built on top of C, is called hybrid. One of the design decisions made with Smalltalk was that all classes would be derived in a single hierarchy, rooted in a single base class (called Object – this is the model for the object-based hierarchy). You cannot create a new class in Smalltalk without inheriting it from an existing class, which is why it takes a

Powered by MyScript