Program 1 (Worth 70 points)

advertisement
Program 1 (Worth 70 points)
Program 2 (worth 80 points)
Write a program that asks for two
integer values. If the first number is
greater than the second, display
number 1 20 times. Otherwise, display
number 2 20 times.
Write a program that asks for an input
of three strings. For each string, get its
size. Get the average of these 3 sizes.
Now display all three strings in loop
repeatedly. The loop runs as many
times as the average. If the average was
10, the loop runs 10 times.
Program 3 (Worth 90 points)
Program 4 (worth 100 points)
Generate a random number between 0100. Display this number.
Generate two random numbers from 01000. You program is to find the least
common multiple (LCM) of these
numbers.
If the number is between 0-25, ask the
user to input two doubles. Take these
doubles and multiply them together and For example, the LCM of 100 and 25 is 5
show the output.
since 5 is the smallest number that
divides both 25 and 100.
If the number is between 26-50, ask the
user to enter a string. Display this string The LCM of 50 and 10 is 2
as many times as its size.
The LCM of 69 and 13 is nothing since
13 is a prime.
If the number is higher than 50, ask for
input to three integers and display their Display your results.
sums.
Download