Exercises01
Exercises01
5. Draw the following Christmas tree. The program should ask the
user the length of the tree.
Sample output
Input First Name: Mugisha
Input Last Name: Sam
Name in reverse is: Sam Mugisha
19. Write a program which accepts the radius of a circle
from the user and compute the area and circumference. The
area and circumference must be in separate functions.
20. Write a program with a function to compute the volume
of the cube on user input.
21. Write a program with a function to read three integers
and to print them in ascending order
22. Write a program with a function that is required that
checks strings to see if they are palindromes. A palindrome
string that reads the same, backwards, or forwards. For
example,
I was able no on elba saw I
Continue? y
PART B: MEDIUM
countDigit(33331, 3) returns 4
countDigit(33331, 6) returns 0
countDigit(3, 3) returns 1
Examples
Examples
{1} 1
{1, 2} -1
{1, 2, 3} 2
{1, 2, 3, 4} -2
{3, 3, 4, 4} -2
{3, 2, 3, 4} 0
{4, 1, 2, 3} -2
{1, 1} 2
{} 0
Examples