Write c program that prompt the user to enter a line of text

Assignment Help C/C++ Programming
Reference no: EM131309026

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, and then to Sentence case.

Your program should use a character array: text[51]. It should use the gets function to prompt the user for the line of text.

Your program must use pointer notation and pointer math (i.e. no array index notation other than in the declaration section).

The dialog with the user must look like:

Enter a line of text (up to 50 characters):

ThiS is A LiNe of teXt! And this is TOO.

The line of text in uppercase is:

THIS IS A LINE OF TEXT! AND THIS IS TOO.

The line of text in lowercase is:

this is a line of text! and this is too.

The line of text in sentence case is:

This is a line of text! And this is too.

Note: The coral 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 try!). Also note that what the user types in is indicated by the blue area above. Again, for clarity only.

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.

Real BIG hint:

You can click on the Assign_4_Hint link which provides a solution to the program using array notation. You can use it as a guide, if you so choose. An arrow symbol (->) at the beginning of a particular line of code indicates which lines of code need to be modified.

In the sentence case make sure every first letter after a period, exclamation or question mark is uppercase.

Reference no: EM131309026

Questions Cloud

Why would fear of inflation lead to losses for bondholders : Suppose you bought a $10,000 ten-year fixed rate bond issued by the U.S. Treasury in July 2007 that paid 5% interest. In July 2010, new seven-year fixed rate bonds were being sold by the Treasury that paid 2.43%. Explain clearly what was likely to..
Loan without compensating balance : Suppose your firm is seeking a six-year, amortizing $790,000 loan with annual payments and your bank is offering you the choice between a $839,000 loan with a $49,000 compensating balance and a $790,000 loan without a compensating balance. The intere..
What will happen to interest rates in each of these cases : Explain what will happen to holdings of bonds and money if there is an excess supply of money in the economy. What will happen if there is an excess demand for money in the economy? What will happen to interest rates in each of these cases?
Dividends- what is the current share price : Synovec Co. is growing quickly. Dividends are expected to grow at a rate of 22 percent for the next three years, with the growth rate falling off to a constant 7 percent thereafter. If the required return is 12 percent, and the company just paid a di..
Write c program that prompt the user to enter a line of text : 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, and then to Sentence case.
How will you conduct more research : How will you conduct more research? What do you need to know to make a recommendation? What is the purpose of your report?
Recommendation on the net present value of the outlay : Cautionary? Tales, Inc., is considering the acquisition of Danger Corp. at its asking price of ?$160,000. Cautionary would immediately sell some of? Danger's assets for ?$16,000 if it makes the acquisition. Danger has a cash balance of ?$1,600 at the..
Finds the maximum expected value of selling a stock : GetSale - Finds the maximum expected value of selling a stock. The expected sale value of a stock is the current profit minus the future value of the stock: Expected Sale value = ( ( Current Price - Buy Price ) - Risk * CurrentPrice ) * Shares.
Why would anyone in zimbabwe willing to accept u.s. dollar : Why would anyone in Zimbabwe be willing to accept U.S. dollars in exchange for goods and services?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Definition of two queues

Write a code in C language for the definition of two queues, one to hold the process in ready state and one to hold the process in waiting state.

  Consider the following nested loop construct

Consider the following nested loop construct. Categorize its efficiency in terms of the variable n using big-O notation. Suppose the statements represented by the ellipsis require four main memory accesses (each requiring one microsecond) and two dis..

  Evaluates statements of an expression language

Completing and extending the C++ program that evaluates statements of an expression language.

  Write program named demojobs for harolds home services

Create a program named FriendList that declares an array of eight Friend objects and prompts the user to enter data about the friends. Display the Friend objects in alphabetical order by first name.

  Prints the row sums and the column sums

Write a program that reads a 5 x 5 array of integers and then prints the row sums and the column sums

  Creates an enumerated data type year

Implement a C++ program that creates an enumerated data type Year that consists of the twelve months from January to December. Read from input the number of visitors to Olympic Park for each month and then calculate the total number of visitors for a..

  Digital signal processing - employ state-space models

you will program, document, and test a zero-crossing detector, with hysteresis for robustness, that also counts the number of samples between zero crossings.

  Prepare an arbitrary sinusoidal waveform

Create a program to compute the derivative of an arbitrary input function, with arbitrary duration and arbitrary limits

  Aimthis assignment is designed to apply your knowledge on

aimthis assignment is designed to apply your knowledge on microcontroller to build a traffic light system. you are

  Write a function named digit_name

Write a function named "digit_name" that takes an integer argument in the range from 1 to 9 , inclusive, and prints the English name for that integer on the computer screen.

  Store user input - write c++ program

Write C++ program to provide the following functionality - Ask users to enter 10 integer numbers.

  Write and test a function to calculate the sum of the series

stop accumulating the sum when the term to add or subtract becomes smaller than a given small number(precision) oassed as an argument.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd