Demonstrate any means your language has to prevent the modification of values, or to create objects that cannot be modified after they have been creat
Continue ReadingC++: Fibonacci Sequence
The Fibonacci sequence is a sequence Fn of natural numbers defined recursively: F0 = 0 F1 = 1 Fn = Fn-1 + Fn-2, if n>1 Write a function to ge
Continue ReadingC++: Delegates
A delegate is a helper object used by another object. The delegator may send the delegate certain messages, and provide a default implementation when
Continue ReadingC++: Hailstone Sequence
The Hailstone sequence of numbers can be generated from a starting positive integer, n by: If n is 1 then the sequence ends. If n is even then
Continue ReadingC++: Insertion Sort
#include <algorithm> template<class Iterator> void insertion_sort( Iterator a, Iterator end ) { std::iter_swap( a, std::min_ele
Continue ReadingC++: Check That File Exists
In this task, the job is to verify that a file called "input.txt" and the directory called "docs" exist. This should be done twice: once for the curre
Continue ReadingC++: Ackermann Function
The Ackermann function is a classic example of a recursive function, notable especially because it is not a primitive recursive function. It grows ver
Continue ReadingC++: Mutual Recursion
Two functions are said to be mutually recursive if the first calls the second, and in turn the second calls the first. Write two mutually recursive
Continue ReadingBest C++ Books
Reference Style - All Levels A Tour of C++ (Bjarne Stroustrup) The "tour" is a quick (about 180 pages and 14 chapters) tutorial overview of all
Continue ReadingC++: Fractal Tree
Generate and draw a fractal tree. To draw a fractal tree is simple: Draw the trunk At the end of the trunk, split by some angle and draw tw
Continue Reading