Write a C++ program (saved on your desktop as "1.cpp") which repeatedly reads a standard 32-bit floating point number in decimal (exiting when the user enters 0) and prints out the binary representation of that same number (or the nearest number to it) in 8-bit floating point where there is 1 sign bit, 4 exponent bits, and 3 mantissa bits. You should also print out the error (the distance between the number entered and the 8-bit representation) in decimal.
Write a C++ program (saved on your desktop as "2.cpp") which uses Monte Carlo methods to determine how many people must be in a room so that it is more likely than not that some person has a birthday in each month (that is, at least one January birthday, at least one February birthday, etc...). You may assume that February always has 28 days in it.
Recall that the fibonacci sequence is defined as: 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89... -- that is, the first two numbers are each 1, then each subsequent number is the sum of the preceding two numbers. Define the fibPrimes sequence as only the prime numbers in the fibonacci sequence, as in: 2, 3, 5, 13, 89,... Write a C++ program (saved on your desktop as "3.cpp") which repeatedly reads in a number k (exiting when the user enters <0) and prints out the kth fibPrime. Note: your program only has to work for fibPrimes up to 100,000 (that's the fibPrime itself, not k).
Write a C++ program (saved on your desktop as "4.cpp") which includes bubbleSort, quickSort, and radixSort, and sorts vectors entered by the user (first ask the user for the length of the vector, then the individual elements). However, in order to select which sort to use, your program should first scan the entire vector and then, based on the elements in that particular vector, make an educated guess as to which sort would be the fastest and use that one. Print out which sort you used and why, and print out the sorted vector. Then you may getchar() and exit (do not repeatedly sort vectors in this particular program -- only one sort per execution).