Study these functions of the math library. Create a project titled Lab4_Calculator with a single file titled calculator.cpp. Write a program that:
1. absolute value 2. square root 3. ceiling 4. power Select an operation: 4 Enter base: 2 Enter exponent: 3 The result is: 8 Select an operation: ...
I selected a number between 0 and 99, what is it? 30 wrong, it is larger, what is it? 60 wrong, it is smaller, what is it? 50 wrong, it is larger, what is it? 55 wrong, it is smaller, what is it? 53 correct!For your program you need to use predefined randomization functions rand() and srand() as well as the time function time()
rand() takes no arguments. Every time rand() is invoked it returns an integer value between 0 and constant RAND_MAX defined in cstdlib. Note that the sequence of values returned by repeated calls of rand() is uniquely determined by the seed passed to srand(). That is, if srand() is passed the same seed, rand() is going to return the same sequence of numbers. This is helpful for debugging. Check this program for an example of random number manipulation.
Note that random value produced by rand() is out of the required range of 0-99. Use just the last two digits of the number. To get them, compute the remainder of the division by 100 of the number returned by rand()
Do not put srand() inside the loop or anywhere, where it may be invoked more than once - it resets the random number generator.