Silver_Smoulder

Outline for Project 2

Nov 6th, 2019
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.92 KB | None | 0 0
  1. Using a table that contains vowels.
  2.  
  3. Enter a word and print all the vowels in the word
  4.  
  5. Print how many times each vowel occurs remember y is only a vowel if no other letters in the word are vowels.
  6.  
  7. All input is to be in lower case.
  8. to set up the table you may use .word 'a','e','i','o','u','y'
  9. note: the characters are in single quotes this will set up a table that looks like this in memory
  10. 0x00000061 0x00000065 0x00000069 0x0000006f 0x00000075 0x00000079
  11. you can make your table bytes or whatever else you'd like
  12.  
  13. name your file firstInitianLastNameP2.asm or it will not be graded (my file would be named ELichtenthalP2.asm)
  14.  
  15. be sure to comment and upload your file
  16.  
  17. no word will be more that 15 characters
  18.  
  19. your counters should be an array of 6 elements in memory
  20.  
  21. example
  22. counters: .word 0,0,0,0,0,0
  23.  
  24. you should have at least 1 function. register usage must be adhered to with all functions. parameters a registers, returned vales a registers, caller and callee registers saved and restored.
  25.  
  26. Extra credit
  27.  
  28. must do all to receiver extra credit. input can be upper or lower case or numbers or special characters, and can be multiple words. If multiple words, output the vowel count for each word separately
  29.  
  30. sample runs
  31.  
  32. Enter a word
  33. happy
  34. the vowels and their count are
  35. a - 1
  36.  
  37. -- program is finished running --
  38.  
  39. Enter a word
  40. why
  41. the vowels and their count are
  42. y - 1
  43.  
  44. -- program is finished running --
  45.  
  46. Enter a word
  47. receiver
  48. the vowels and their count are
  49. e - 3
  50. i - 1
  51.  
  52. -- program is finished running --
  53.  
  54. Enter a word
  55. monopoly
  56. the vowels and their count are
  57. o - 3
  58.  
  59. -- program is finished running --
  60.  
  61. Enter a word
  62. onomatopoeia
  63. the vowels and their count are
  64. a - 2
  65. e - 1
  66. i - 1
  67. o - 4
  68.  
  69. -- program is finished running --
  70.  
  71. ------------------------------------------MY ALGORITHM------------------------------------------------
  72.  
  73. 1) initialize word array made out of .words containing aeiouy, TEST
  74.  
  75. 2) initialize counter array consisting of 6 integers stored in .word, COUNTER
  76.  
  77. 3) prompt user for word and store it in an array size 15, WORD
  78.  
  79. 4) initalize two counters, t0 (for our TEST) and t1 (for our WORD)
  80. a)test t1 against t0
  81. b)if there is no match, increment t0 TEST
  82. c) if there are no matches when you hit the end of t0 TEST, increment t1 WORD and reset t0 TEST
  83. d) if there is a match, increment the COUNTER via the number in TEST (ex: so, if we encounter an "i", our TEST t0 should be at 2, so our COUNTER will get incremented there as well)
  84. e) increment t1 WORD, reset t0 TEST and go again
  85. f) upon reaching the end of t1 WORD, terminate the loop (make this one into the function?)
  86.  
  87. 5) test to check if there are other vowels than "y"
  88. a) if no, output the number of y's
  89. b) if yes, go to 6
  90.  
  91. 6) check each COUNTER for 0
  92. a) if non-zero, output letter and the counter
  93. b) if zero, skip and go to the next one
  94.  
  95. 7) terminate program
Advertisement
Add Comment
Please, Sign In to add comment