Question: Write and test a MIPS assembly language program to count each letter, each even digit, and each odd digit in a text file. The program

 Write and test a MIPS assembly language program to count each

Write and test a MIPS assembly language program to count each letter, each even digit, and each odd digit in a text file. The program should do the following: a) Open a text file "input.txt" and read all characters into an array. Limit the length of the array to 10000 characters. The maximum number of characters to be read should be 10000 characters. MARS provides the system calls for opening and reading a text file. If the file does not exist then the program should display an error message and terminates b) Traverse the array character by character. Count all letters and digits while ignoring the other characters. You should use an array of 26 integer counters for the 26 letters in the alphabet, and two integer counters; one counter to count the even digits in the file, and the other counter to count the odd digits in the file. Do not distinguish between capital and lowercase letter; both should be counted as the same letter c) Display the count of each letter as well as the even-digit count, the odd-digit counts, and the total digit count. A sample run is shown below: Letter Count 67 18 23 5 Even-digit count = 25 Odd-digit count 14 Total digit count39 Write and test a MIPS assembly language program to count each letter, each even digit, and each odd digit in a text file. The program should do the following: a) Open a text file "input.txt" and read all characters into an array. Limit the length of the array to 10000 characters. The maximum number of characters to be read should be 10000 characters. MARS provides the system calls for opening and reading a text file. If the file does not exist then the program should display an error message and terminates b) Traverse the array character by character. Count all letters and digits while ignoring the other characters. You should use an array of 26 integer counters for the 26 letters in the alphabet, and two integer counters; one counter to count the even digits in the file, and the other counter to count the odd digits in the file. Do not distinguish between capital and lowercase letter; both should be counted as the same letter c) Display the count of each letter as well as the even-digit count, the odd-digit counts, and the total digit count. A sample run is shown below: Letter Count 67 18 23 5 Even-digit count = 25 Odd-digit count 14 Total digit count39

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!