Some programming languages have ways of expressing integer literals in bases other than the normal base ten. Show how integer literals can be expre
Continue ReadingC++: Josephus Problem
Josephus problem is a math puzzle with a grim description: n prisoners are standing on a circle, sequentially numbered from 0 to n − 1. An execut
Continue ReadingC++: Fibonacci N-Step Number Sequences
These number series are an expansion of the ordinary Fibonacci sequence where: For n = 2 we have the Fibonacci sequence; with initial values [1,1
Continue ReadingC++: Factorial
The Factorial Function of a positive integer, n, is defined as the product of the sequence n, n-1, n-2, ...1 and the factorial of zero, 0, is defined
Continue ReadingC++: Bitwise Operations
Write a routine to perform a bitwise AND, OR, and XOR on two integers, a bitwise NOT on the first integer, a left shift, right shift, right arithmetic
Continue ReadingC++: Array Concatenation
Show how to concatenate two arrays in your language. If this is as simple as array1 + array2, so be it. #include <vector> #include <ios
Continue ReadingC++: Animate a Pendulum
One good way of making an animation is by simulating a physical system and illustrating the variables in that system using a dynamically changing grap
Continue ReadingC++: 99 Bottles of Beer
The beersong In this puzzle, write code to print out the entire "99 bottles of beer on the wall" song. For those who do not know the song, the l
Continue ReadingC++: Black Scholes Call Option Vega
// Calculate the Black Scholes European call option Vega double BS_Call_Option_Vega(double S, double K, double r, double v, double T) // Parame
Continue ReadingC++ String Algorithms
[pt_view id="ce50e34ece"]
Continue Reading




