FIT1047: Your name as a MARIE string This is the first task you need to submit It’s just a little warm-up so you can get familiar with strings: Introduction to computer systems, networks Assignment, MUM, Malaysia
University | Monash University Malaysia (MUM) |
Subject | FIT1047: Introduction to computer systems networks |
Task 2.1:
Your name as a MARIE string (4 marks) This is the first task you need to submit. It’s just a little warm-up so you can get familiar with strings. Similar to the FIT1047 example above, encode your name using ASCII characters. You should encode at least 10 characters – if your name is longer, you can shorten it if you want, if it’s shorter, you need to add some characters (such as !?! or …, or invent a middle name). In the assignment template, you will find a label Name, which is initialized to the value HEX 0. You need to change this part of the code so that after assembling, the MARIE memory contains the string with your name starting at label Name.
Are You Searching Answer of this Question? Request Malaysian Writers to Write a plagiarism Free Copy for You.
Task 2.2:
Convert to upper case (8 marks) In this task, you need to write a subroutine that takes the user’s input and converts it into upper case. The subroutine is called ToUpper. It expects one argument to be passed in using the label ToUpperWord, which is the starting address of the string to be converted. The subroutine loops through the input string one character at a time. For each character, if it is a lowercase character, it replaces it with the corresponding uppercase character. Once the end of the string is reached, the subroutine returns. Test cases: The template already contains one test case. Add another 3 test cases and document them. For each case, a document which part of the subroutine it is supposed to test, as well as the expected outcome.
Task 2.3:
Test if a word contains a certain character (10 marks) Here, you will write a subroutine that can check if a word contains a given character. The subroutine is called StringContains and takes two arguments: the first is passed in the label StringContainsStart and contains the address in memory where the string starts. The second is passed in the label StringContainsChar, which holds the character to search for. When the subroutine returns, it stores a 1 in the address at the label StringContainsResult if the character was found, and a 0 if it wasn’t found. The subroutine should follow these steps: – Loop through all the characters in the given input string. – If the current character is the end-of-string character 0, then store 0 in StringContainsResult and return. – If the current character is equal to the one in StringContainsChar, then store 1 in StringContainsResult and return. – Otherwise, move on to the next character and continue the search. FACULTY OF INFORMATION TECHNOLOGY Test cases: The template already contains one test case. Add another 4 test cases and document them. For each case, a document which part of the subroutine it is supposed to test, as well as the expected outcome.
Get Solution of this Assessment. Hire Experts to solve this assignment for you Before Deadline.
Task 2.4:
Check a guess (10 marks) In this task, you implement the core of the game. You need to write a subroutine CheckGuess that compares the player’s input with the selected word and outputs the clues for the next round. The subroutine has two arguments. The first, which is passed in the label CheckGuessedWord, is the address in memory where the string starts that the player guessed. The second argument is passed in the label CheckSelectedWord and contains the address where the string of the selected word starts. For simplicity, we will assume that both words only contain uppercase characters. The algorithm for checking a guess needs to work as follows. Loop through both strings simultaneously, one character at a time: – If the current character in the guessed string is 0 (i.e., the end of the string), check if the current character in the selected word is also 0. If yes, return from the subroutine. If not, output the error message “Your word is too short” and return from the subroutine. – If the current character in the selected word is 0, but the current character in the guessed string is not 0, output the error message “Your word is too long” and return from the subroutine. – If the current character in the guessed word is equal to the current character in the selected word, output the character (it will be an uppercase character, which indicates a correct guess). – Otherwise, use your subroutine from Task 3 to test if the current character in the guessed word occurs somewhere else in the selected word – If yes, output the lowercase version of the character (since it’s a good guess but in the wrong position). – If not, output an underscore character. Test cases: The template already contains one test case, which calls the subroutine with GREAT as the guessed word and WORDS as the selected word. The output of your subroutine for this test case should be _r___, i.e., an underscore character (because g does not occur in words), followed by lower-case r (because r occurs but in a different position), followed by three underscores (because e, a and t do not occur in words). Add five more test cases and document them. For each case, a document which part of the subroutine it is supposed to test, as well as the expected outcome
Stuck in Completing this Assignment and feeling stressed ? Take our Private Writing Services.
Recent Solved Questions
- What type of oral dosage form generally yields the greatest amount of systemically available drugs in the least amount of time: Pharmacology Assignment, MSU, Malaysia
- Critically discuss pertaining to the FIVE (5) important viewpoints on what makes a Good Project Manager to decide on the above matter: Procurement Management Case Study, Malaysia
- Shanghai International Port (Group) Co. Ltd (SIPG), the operator of public terminals in Shanghai’s port is a large scale specialized: Shipping Management Assignment, NMIT, Malaysia
- On 2.2.2021, Sahid entered into a hire purchase agreement with Kejora Finance Bhd for the hire purchase of a new Proton Perdana Motor car: COMMERCIAL LAW Assignment, UM, Malaysia
- EBB31203: Shariah is a term used to describe the rules of the lifestyle (Deen) ordained by Allah SWT. It is characterized as a “complete way of life”: Islamic Financial Plan Construction & Professional Responsibilities Assignment, UBS, Malaysia
- ACC4304: Write an essay that critically evaluates the impact of an accounting scandal on auditor independence and audit quality: Auditing Essay, HU, Malaysia
- Please analyze the financial statements of 2 companies for the period of 3 years that you have chosen from your group: Financial Management Assignment, MMU, Malaysia
- G0302: Submitting or presenting someone else’s work, words, ideas, data or information as your own intentionally or unintentionally: Web Site Design Report, XUM, Malaysia
- ACC7102E: You are expected to be resourceful, innovative and creative when communicating and presenting your discussion: ACCOUNTING AND FINANCE FOR MANAGERS Assignment, UOM, Malaysia
- BUS7AQ: Detail how you would set about managing change in a small traditionally based SME family business in food manufacturing: Creative Change Assignment, WGU, Malaysia