Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Objective Write an ARM program that takes a string as input and outputs the number of vowels in the string. Here is pseudocode for the
Objective
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:
Print greeting and ask for string
use printf, format string is argument to printf, place in
Set a saved register xx to zero to be used as a counter
Scanf to read input
format string is first argument, place in
address in memory where string will be put is second argument
Load the input char from memory into a register Idrb
Check if the char is a null or newline chararacter, if it is go to step
Otherwise check if the char is a vowel ie compare the char with the ascii values of I,
If it is a value, increment the counter register
Go to step
Use printf to print the counter's value
contains format string, contains a value to replace the format specifier with
Run exit sequence
Compiling and Running Your Code
Compiling:
gcc o pa pas g
Running:
pa
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started