Create a function/use an in-built function, to compute the dot product, also known as the scalar product of two vectors. If possible, make the vectors
Continue ReadingC++: Greatest Element of a List
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++: Minesweeper Game
There is an n by m grid that has a random number (between 10% to 20% of the total number of tiles, though older implementations may use 20%..60% inste
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++: Discordian Date
Convert a given date from the Gregorian calendar to the Discordian calendar. #include <iostream> #include <algorithm> #include <
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++: 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++: 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++: Here Document
A here document (or "heredoc") is a way of specifying a text block, preserving the line breaks, indentation and other whitespace within the text. D
Continue Reading




