Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Programming Assignment #4 Write a C program that prompts the user to enter a line of text (up to 50 characters). It should then convert

image text in transcribed
image text in transcribed
Programming Assignment #4 Write a C program that prompts the user to enter a line of text (up to 50 characters). It should then convert the text entered to uppercase letters and then to lowercase letters. Your program should use a character array: text(51] to store text. It should use function safer_gets0 to prompt the user for the line of text. Your program must use pointer notation and pointer math fi.e no array index The dialog with the user must look like: Enter a line of text (up to 50 characters) ThiS is A LiNe of teXt with UPPER and lower CaSe charactERS The line of text in uppercase is: THIS IS A LINE OF TEXT WITH UPPER AND LOWER C The line of text in lowercase is: this is a line of text with upper and lower case c Note: The blue text represents the "output" from your program and is shown for clarity only here. It is not required that your output be in this color. (Do not even attempt to tryl). Also note that what the user types in is indicated by the bolded black text above. Again, for clarity only. (Notice that text is truncated once the 50 character limit has been reached - this would be handled in function safer_gets). Hints Your program requires 2 loops (either for or while). One to convert and display the string in uppercase letters, and the other to convert and display the string in lowercase letters Your program should use the C standard library functions toupper in one of the loops, and tolower in the other loop, to convert the string. Both of these functions are found in the header file ctype.h. You do not need to convert function safer gets0 to pointer notation. . Reall int: You can click on the "Assig 4 Hint" link which provides a solution to the program using array notation. You can use it as a guide if you so choose Note: An arrow symbol(>) at the beginning of a particular line of code indicates that the line of code needs to be modified for pointer notation. Good luck

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

Hands On Database

Authors: Steve Conger

1st Edition

013610827X, 978-0136108276

More Books

Students also viewed these Databases questions