Question: Write an ARM program that takes a string as input and outputs the number of vowels in the string. Here is pseudocode for the solution:

Write an ARM program that takes a string as input and outputs the number of vowels in the string.
Here is pseudocode for the solution:
Input: string
Output: print out of integer number of vowels in string
Pseudocode:
1. Print greeting and ask for string
use printf, format string is argument to printf, place in x0
2. Set a saved register (\times 19-x27) to zero to be used as a counter
3. Scanf to read input
format string is first argument, place in x0
address in memory where string will be put is second argument
4. Load the input char from memory into a register - Idrb
5. Check if the char is a null or newline chararacter, if it is, go to step 8
6. Otherwise check if the char is a vowel (i.e. compare the char with the asci values of A,E.I.O,U,a,e,j,o,u)
If it is a value, increment the counter register
7. Go to step 4
8. Use printf to print the counter's value
Submit

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!