Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Create a program that will go through a NULL-terminated string of ASCII characters and convert any uppercase letters to lowercase letters. (The ASCII

1. Create a program that will go through a NULL-terminated string of ASCII characters and convert any

1. Create a program that will go through a NULL-terminated string of ASCII characters and convert any uppercase letters to lowercase letters. (The ASCII NULL character is Ox00.) Any changes should replace the original values within the string in memory. The program should be able to process strings of arbitrary length, although you may assume that the maximum length is no more than 20 characters. Therefore, you should allocate 20 bytes of memory in the data section to accommodate the worst-case string length. Things to consider: How far apart are uppercase and lowercase ASCII code values? You don't want to modify every single character. If you read a lowercase letter, a numeric digit, a space, or punctuation, there's nothing that needs to be modified. When you reach the NULL value, there's nothing left to change. Code must be commented well enough for a reader to know what you're doing and why. 2. Test the program on a string containing an assortment of character types. You can allocate memory for the character string and set it to an initial value with the asciz directive, or you can allocate memory with the .space directive and use the GDB set command in the Debugger Console to write a character string to the memory. (GDB set command examples are presented in section F of the debugging tutorial.) Run the program twice, using two different strings of different lengths between 12 and 19 characters, each containing some uppercase letters, some lowercase letters, and at least one numeric digit, one punctuation character, and one space. (Sounds like a password?) 3. Submit: The source program The two debugger memory views, circling the final strings after the program has run. Use memory rendering format ASCII to display the strings.

Step by Step Solution

3.49 Rating (162 Votes )

There are 3 Steps involved in it

Step: 1

Here is a simple C program that convert... 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

Computer Organization and Design The Hardware Software Interface

Authors: David A. Patterson, John L. Hennessy

5th edition

124077269, 978-0124077263

More Books

Students also viewed these Programming questions

Question

Describe and sketch the surface. 16x + 16y -9z = 0

Answered: 1 week ago

Question

4 Where and how can CPW create further international sales growth?

Answered: 1 week ago