Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Display the total count of letters, digits, special characters, and lines. look at the sample.. assume you have the txt file.. put comments for understanding

Display the total count of letters, digits, special characters, and lines. look at the sample.. assume you have the txt file.. put comments for understanding

image text in transcribed

Counting Letters, Digits, Special Characters and Lines in a Text File Write and test a MIPS assembly language program to count each letter, digit, special character, and number of lines in a text file. The program should do the following: a) Open a text file "input.txt" and read all characters into an array in memory. Limit the length of the array to 10000 characters. The maximum number of characters to be read should be 10000 characters. The actual number of characters depends on the file length. 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, digits, and all other special characters. In addition, count the lines (A line ends with a ' ' character). A single-letter/word line is also counted. Do not distinguish between capital and lowercase letter. c) Display the total count of letters, digits, special characters, and lines. If file "input.txt" does not exist in the same folder then output the following error message: Error: input.txt does NOT exist. If file "input.txt" exists then output the following after counting all letters, digits, etc. Letters = 126 Digits = 27 Special Characters = 35 Lines = 31

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Systems Analysis And Synthesis Bridging Computer Science And Information Technology

Authors: Barry Dwyer

1st Edition

0128054492, 9780128054499

More Books

Students also viewed these Databases questions

Question

What are their performance levels?

Answered: 1 week ago