Assn4 - arguments to the function using registers $a0 and...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
CDA 3101 Assignment 4 Due in class on Thursday, Oct. 5 Turn hardcopy in class, stapled, with your name and “CDA 3101 Assignment 4” clearly written on it. For programs, submit a printout with your hardcopy, in class. Also, submit the program for Problem 4 below electronically, via WebCT Assignment Tool. You must use the WebCT Assignment Tool to submit your code; you cannot submit your code using email. 1. Problem 2.15 from the textbook. 2. Problem 2.29 from the textbook. 3. Problem 2.30 from the textbook. 4. Write a function Scan(&X, N) to scan an array X of N bytes, counting how many bytes are ASCII codes for a. Uppercase letters b. Lowercase letters. You can assume that the array X has only lower case or upper case letters and no other characters. The address of the array X and the number of bytes N are passed as
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: arguments to the function using registers $a0 and $a1 respectively and the function will return the number of uppercase and number of lowercase letters in registers $v0 and $v1. Also, write a short main program that i. dynamically allocates memory for storing a string of 16 characters (including the null character), ii. prompts the user to enter a string iii. stores the string entered by the user into the allocated memory iv. calls the Scan function to count and return the number of uppercase and number of lowercase letters in the string entered by the user v. prints the number of uppercase and lowercase letters as returned by the Scan function on screen....
View Full Document

Ask a homework question - tutors are online