Array Exercises
Array Exercises
Create an array with the following names Francis, Anthony, Paul, Peter, Francis, John, Luke, Francis,
Paul, Francis. Your program is then to count the number of times each name appears in the array.
Pseudocode
ARRAY SAINTS = FRANCIS, ANTHONY, PAUL, PETER, JOHN, LUKE, FRANCIS, FRANCIS, PAUL, FRANCIS
NAME COUNTER++
Array Exercise 2
Create an array with the following names John, Paul, Ringo, George, Keith, Mick, David, Elvis,
Richard, Frank. Your program is to count how many letters they have in their names. The display
should be: John Has 4 Letters.
Array Exercise 3
Create an array with the following names John, Paul, Ringo, George, Keith, Mick, David, Elvis,
Richard, Frank. Your program is to count the number of vowels they have in their name. For
example, John has 1 vowel in its name.
Array Names = John, Paul, Ringo, George, Keith, Mick, David, Elvis, Richard, Frank
Int counter = 0
Counter ++
Int Counter = 0
Array Exercise 4
Create an array with 20 numbers. Then inside program is to count the number of even and odd
numbers in the array. The display should be.
Number of Even numbers =
Number of Off numbers =
start
print "enter the number - "
read number
if number mod 2 = 0 then
else
end if
Array Exercise 5
Create 2 arrays.
rank = { "2", "3", "4", "5", "6", "7", "8", "9", "10",
"Jack", "Queen", "King", "Ace"}
Your program is to generate a random card and display the result. For example Ace of Diamonds
Lotto number generator. Create a program that will store 8 random numbers into an array. Once 8
numbers have been reached the output should display Your winning numbers are: .
Please note that once a number has been generated it cannot be used again.