Comp Sci C++ Program: Write a Program to Read Paragraphs

  • Thread starter Thread starter abedhamayl
  • Start date Start date
  • Tags Tags
    C++
AI Thread Summary
The discussion focuses on creating a C++ program that reads a four-line paragraph of text, allowing for extra spaces between words, with specific output requirements. Key outputs include a frequency table of alphabet letters, a cleaned-up version of the paragraph, average word length, a sorted list of words, and the lines sorted by length. Participants emphasize the importance of adhering to homework policies, noting that users must show their own work and thought processes. There is also a query regarding how to input names into a two-dimensional character array in C++. The conversation highlights the need for clear coding practices and understanding of pointers in C++.
abedhamayl
Messages
4
Reaction score
0
Write a program that reads a paragraph of 4 lines of text. The user can enter extra spaces between words. The length of each line does not exceed 50 characters. The program should output the following: ((Use pointers))

1. A table indicating the occurrence of each letter of the alphabet in the text.
2. The input paragraph without extra spaces between words.
3. Average word length in the paragraph.
4. The list of words in the paragraph sorted in alphabetical order.
5. The 4 lines in the paragraph sorted in ascending order of length.


please help me
 
Physics news on Phys.org
Please post homework questions in the appropriate homework forums. (I have moved this thread there)

And please review our homework policy -- we will not do your work for you! You must indicate what work you've done, and what thoughts and analyses you've done on the problem -- if you don't show us that you've worked on the problem, then we won't work on the problem either.
 
just i want to
char *n[40][50];
cin>>*n;
how i can enter the names in this array and stop will i enter the new line
 
i use a
visual stdio 6.0
 
wher are you
 
Thread 'Have I solved this structural engineering equation correctly?'
Hi all, I have a structural engineering book from 1979. I am trying to follow it as best as I can. I have come to a formula that calculates the rotations in radians at the rigid joint that requires an iterative procedure. This equation comes in the form of: $$ x_i = \frac {Q_ih_i + Q_{i+1}h_{i+1}}{4K} + \frac {C}{K}x_{i-1} + \frac {C}{K}x_{i+1} $$ Where: ## Q ## is the horizontal storey shear ## h ## is the storey height ## K = (6G_i + C_i + C_{i+1}) ## ## G = \frac {I_g}{h} ## ## C...
Back
Top