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

  Farey fractions of level one

Write a program that for a number n entered by the user creates-by constantly extending it-a linked list of fractions at level n and then displays them.

  Implement a class called singlylinkedlist

Prepare a C++ program that will run in Microsoft Visual Studio 2012 - In the main function, instantiate the SinglyLinkedList class. Your program should provide a user loop and a menu so that the user can access all the operators provided by the Sin..

  Declare two character arrays

Write a C program for Code warrior, to declare two character arrays called list1 and list2. Initialize list1 with your first and last name. Write the main code to copy list1 to list2.

  Write a program to convert miles to kilometers

Write a program to convert miles to kilometers. (Recall that 1 mi = 1.6093440 km.) Write a program to convert pounds to kilograms. (Recall that 1 kg = 2.205 lb.) Write a program to compute the area of A of a circle with radius r.

  Presented a number of recurrence relations

For this problem set, you will be presented a number of recurrence relations and asked to state their actual time complexity, showing your work in the process.

  Focuses on learning to create threads and use

Create a thread in either a C or a Java program and run it. The thread should read a keyboard value "x" and exit from the code, or it can also use an "ESC" to exit.

  Write a function that returns a pointer to an array

Write and show a function that takes an integer n and returns a pointer to an array of the first n cubes (0, 1, 8, 27, and so on).

  Convert the c++ code into matlab code

Can you convert the c++ code into matlab code

  Write code that declares an int array named month

Write code that declares an int array named month with 5 rows and 7 coloumns and initializes every element to -1.

  Types of intruder detection techniques

Identify and fully explain two types of intruder detection techniques. With the aid of a fully labeled diagram, explain the use of Public-Key Encryption between two communication devices/users.

  Write a program using the class as defined

Write a program using` the class as defined below. Put the class definition in a separate header file, and put all the functions' code in a separate Resource file.

  International space station

Let's say you own a company that makes bolts that are used on the International Space Station! These bolts have very specific requirements but two of the most important requirements are strength and heat resistance. NASA says that you must have a ..

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