Starting from:

$25

COMP3353-Project 4 Program that Determines if 2 Strings are Anagrams Solved

The objective of this assignment is to create a program that will determine if two strings are anagrams. If the two strings are anagrams, then EAX will have the value 1 after the code has completed. If they are not anagrams, then EAX will have the value 0.

 

Two .java implementations are in the “files” section in Canvas. Feel free to use one of these or another method.

 

All “high level” directives are not allowed on this homework. (e.g. IF, ENDIF, REPEAT, etc.)

 

What is anagram? From dictionary.com:

 

an·a·gram
 

/ˈanəˌɡram/ 

 

noun 

 

noun:   anagram; plural noun: anagrams 

a word, phrase, or name formed by rearranging the letters of another, such as cinema, formed from iceman.

 

You can read more about in Wikipedia: https://en.wikipedia.org/wiki/Anagram

 

Design: 

 

Create a BYTE array with the label ‘s1’. This array may be of any length between 2 and 100.

 

Create a BYTE array with the label ‘s2’. This array should be the same length as ‘s1’.

 

You may create any other values you deem necessary.

 

The program should compare the two strings to determine if they are anagrams.

 

Assume that each of the arrays (s1 and s2) will be the same length. Also assume that all characters in the array will be capital letters.

 

Program:

 

Your job is to implement a MASM version of the java program ‘AnagramCounter.java’ or ‘AnagramReplace.java’, or with your own reasonable method.

 

(90 points) 9 lines to implement commented with numbers from (1) to (9). See template for details.

 

Example:

 

s1 BYTE   “GARDEN” s2 BYTE “DANGER”

After the code completes EAX would have the value 1. (These are anagrams)

 

Another example: s1 BYTE “CODE” s2 BYTE  “DOGS”

After the code completes EAX would have the value 0. (These are not anagrams)

 

Remember that your program must be flexible enough to handle a string of any length. I could test with a string of length 2 or 100 or any number in between.

More products