Create a function that returns the maximum value in a provided set of values, where the number of values may not be known until runtime. This will
Continue ReadingC++: Exponentiation Operator
Most all programming languages have a built-in implementation of exponentiation. Re-implement integer exponentiation for both intint and floatint as b
Continue ReadingC++: Infinite Loops
Specifically print out "SPAM" followed by a newline in an infinite loop. while (true) std::cout << "SPAM" << std::endl; or
Continue ReadingC++: Ethiopian Multiplication
A method of multiplying integers using only addition, doubling, and halving. Method: Take two numbers to be multiplied and write them down at
Continue ReadingC++: Accumulator Factory
A problem posed by Paul Graham is that of creating a function that takes a single (numeric) argument and which returns another function that is an acc
Continue ReadingC++: Construct from Rational Number
To understand this task in context please see Continued fraction arithmetic The purpose of this task is to write a function r2cf(int N1,int N2), or
Continue ReadingC++: Hash From Two Arrays
Using two Arrays of equal length, create a Hash object where the elements from one array (the keys) are linked to the elements of the other (the value
Continue ReadingC++: Median
Write a program to find the median value of a vector of floating-point numbers. The program need not handle the case where the vector is empty, but mu
Continue ReadingC++: First-Class Functions
A language has first-class functions if it can do each of the following without recursively invoking a compiler or interpreter or otherwise metaprogra
Continue ReadingC++: Image Noise
Generate a random black and white 320x240 image continuously, showing FPS (frames per second). Sample image: #include <windows.h> #
Continue Reading