Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

What Is A Database And How Do I Use It

Authors: Matt Anniss

1st Edition

1622750799, 978-1622750795

More Books

Students also viewed these Databases questions

Question

a donor to the university or school?

Answered: 1 week ago

Question

1. Identify what positions are included in the plan.

Answered: 1 week ago

Question

2. Identify the employees who are included in the plan.

Answered: 1 week ago