Program 1 If the number is even, divide it by 2. If the number is odd, multiply it by 3 and then add 1. For example, if the original number were 13, the algorithm would generate the following sequence of numbers: 13, 40, 20, 10, 5, 16, 8, 4, 2, 1. This sequence has 10 terms counting the original number and the 1. Write a program that accomplishes the following three functions: Prompts the user for a positive integer input, or a zero to exit. This prompt should be repeated if the user enters a negative number. Outputs all the numbers in the sequence produced by the Ulam algorithm. Counts how many numbers are in the sequence, and outputs the count. ------------------------------------------------------- Program 2 A standard science experiment is to drop a ball and see how high it bounces. This establishes a "bounciness" index equal to the original height divided by the bounce height. The bounciness index is between 0 and 1 (including 0 but not including 1). This index is independent of the original height. For example, if the original height were 10 feet and the bounciness index were 0.6, the height of the first bounce would be 6 feet (10 * 0.6); and the height of the second bounce would be 3.6 feet (6 * 0.6). The total distance traveled on a bounce is the distance down plus the bounce up. Write an interactive program that accomplishes the following three functions: Gets the height and bounciness from the user. The height must be at least 0 and the bounciness must be equal to or greater than 0 and less than 1. You must error check both of these inputs. Calculates the total distance that the ball travels in 100 bounces and finds the height of the final bounce.
## Deliverables
1) Complete and fully-functional source code. 2) Need it ASAP.
## Platform
Pascal Delphi 6
## Deadline information
I need it by tomorrow Sunday the 6th.