Question: Write a function name randValues0to9 that takes a string from the user as an argument and generates a random integer between 0 to 9. To

Write a function name randValues0to9 that takes a string from the user as an argument and generates a random integer between 0 to 9. To generate a random value you need a seed. As your range is 0 to 9, by doing seed%(9+1), you will get a random value between 0 to 9. To generate the seed, you need to count the number of vowels and consonants in that argument. If the vowels are less in number than the consonants, then your seed will be, seed = no_of_vowels*no_of_consonants+21. Otherwise, your seed will be, seed = no_of_vowels*no_of_consonants+57 ================================================ Function Call1: randValues0to9("H@#ello Pe3ter!!") Sample Output1: Vowels: 4 Consonants: 6 Seed: 45 Random value: 5 Explanation1: In H@#ello Pe3ter!!: string, there are 4 vowels and 6 consonants. So the vowels are less in number than the constants and the seed is, seed = no_of_vowels*no_of_conostants+21 => seed = 4*6+21 = 45 As your seed is 45, your random value is 45%10 = 5. ================================================ Function Call2: randValues0to9("Ayeeeeeeeeeeeee lmao")

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!