Write a program that uses a variable inside of a for loop to output the following pattern:
2
4
8
16
32
64
128
256
512
1024
It should match the following output: see image.
Write a program that will calculate savings by buying tickets in bulk. The ticket cost per ticket is $64.50 per ticket. Have the user enter the number of tickets to purchase. If the user selects a number greater than 5, apply a 25% discount per ticket. Otherwise, apply a 5% discount per ticket. Output the results
It should match the following output: see image. see image.
Write a program that simulates tossing a coin using a function named CoinToss(). The function should take no arguments, but return a string "Heads" or "Tails" back to main.
Inside of CoinToss(), you will need to get a random number using rand() and limit that return to either a zero or a one. If the number returned from rand is zero, return "Heads" back to main. If the random number is one, return the string "Tails" back to main.
In main, ask the user to input the amount of times they wish to run the coin toss simulator. You must use a loop to control the function call of CoinToss().
Think: This is a known counted number of times that you will be asking for CoinToss() function to run. Use the right counted loop.
A successful program will look like the following: see image. see image.