0

Hello,

I am currently working on an algorithm and i am quite confused.

The algoritm is:

Put q = 19
1. For i=1 to 3
If the ith element of the list is a letter then
If the letter’s position in the alphabet is an odd number then
q = q+ 4
else
If the ith element is numeral n then
q = q + n.
2. Return q.

I have AB56 for the category number(the list). What I did was that I used a table with 3 columns. i, CatNumber and d. But I am still confused how to fill the table.
by following the algorithm. Should I have an additional q column in the table?

Thanks

3
Contributors
6
Replies
8
Views
5 Years
Discussion Span
Last Post by london-G
0

Notice that only three first letters have effect, rest of input does not count for result. categorize three columns with the two alternative branches and third for other input(like space or punctuation) for pass.

0

Yes I know about listing all the variables however I don't know in what format I should display the variables and the step it changes. Will a table do?

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.