Professional Documents
Culture Documents
Ducat Logical
Ducat Logical
1) Create a 3X5 matrix structure[2 dimensional array] by choosing random values from the reel Array
given below:
Reel Array
[AA, BB, AA, EE, BB, GG, LL, KK, CC, DD, FF, BB, EE, AA, KK]
Program: _______________
2) Find the Number of Alphabets used and their count of being present into a string.
For eg. CCNA
Has
C: 2
N:1
A:1
Result must contain only those alphabets which are used in the string with no duplicate entry.
Program: _______________
3) Create a 5 alphabets string by randomly choosing alphabet from the 26 alphabets [a-z] given that
there is no repetitive alphabet in the resulted string.
Ex: CADBK, KBNRL etc.
4) Table below provides probability of choosing a fruit from the weight table -
Fruit Name Probability(P)
MANGO 0.25
BANANA 0.50
APPLE 0.15
ORANGE 0.10
Total (P) 1
Write a program of randomly choosing 10 fruits from a bucket using the above table.
Output eg.
Array [ORANGE, APPLE,BANANA, …………..] array containing 10 fruits chosen.
5) Write a program to print only even numbers extracted from the given string :
“13-34-5-14-89-60-4-6-5-12”;