Can you help me doing this in PSUEDOCODE NOT JAVA CODE Thank you!! Create a prog
ID: 3607435 • Letter: C
Question
Can you help me doing this in PSUEDOCODE NOT JAVA CODE
Thank you!!
Create a program that converts a string to an encrypted string by changing the values of the vowels to numbers entered by the user. For this task, use two arrays of size 5, one to store the vowels, called Vowels, and one to store the numbers, called Numbers. For example, if the user inputs the number 7 for a, 3 for e, 5 for i, 2 for o and 0 for u. The following two arrays should be created: 1. Vowels Numbers 0 2. Create the method readNumbers that will ask a user for the number corresponding to each vowel and store it in the Numbers array. 3. Create a method encryptString that will receive a String and will change the vowels of the String to the corresponding number. For example, using the example numbers provided in 1, if this method receives "This is easy peasy lemon squeezy" it will return "Th5s 5s 37sy p37sy 13m2n squ33sy 4. Create the main method of your program that will: a. Read the numbers for encryption. b. Ask the user: Do you want to encrypt a string? (Y/N) If the answer is "Y", the system should request as an input the string and print the encrypted string. Repeat this until the user indicates he/she doesn't want to encrypt a string, i.e., answer is "N". Trace your program with the following answers from user: 5. a. Ask the user: Do you want to encrypt a string? (Y/N)Explanation / Answer
Psuedocode is as follows:
readNumbers(char v[5],string d[5])
print("Enter value for a :")
input d[0]
print("Enter value for e :")
input d[1]
print("Enter value for i :")
input d[2]
print("Enter value for o :")
input d[3]
print("Enter value for u :")
input d[4]
Main():
Declare char v[5]
Declare string d[5]
Declare String input
Declare String ch
v[0] = 'a'
v[1] = 'e'
v[2] = 'i'
v[3] = 'o'
v[4] = 'u'
readNumbers(v,d)
while true:
print("Enter input string")
Take the input in input
String output = ""
for (i=0 to size of string):
if input[i] == 'a':
ouput = output + data[0]
else if input[i] == 'e':
ouput = output + data[1]
else if input[i] == 'i':
ouput = output + data[2]
else if input[i] == 'o':
ouput = output + data[3]
else if input[i] == 'u':
ouput = output + data[4]
else :
ouput = output + input[i]
ouput the string output
print ("Do you want to encrypt string(Y/N)"
input it in ch
if (ch[0] == 'N')
break
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.