C++ Program: Write a Program to Read Paragraphs

  • Context: Comp Sci 
  • Thread starter Thread starter abedhamayl
  • Start date Start date
  • Tags Tags
    C++
Click For Summary

Discussion Overview

The discussion revolves around writing a C++ program that reads a paragraph of text, processes it in various ways, and outputs specific information. The scope includes programming techniques, particularly the use of pointers, as well as handling user input and string manipulation.

Discussion Character

  • Homework-related, Technical explanation

Main Points Raised

  • One participant requests assistance in writing a program that counts letter occurrences, removes extra spaces, calculates average word length, sorts words alphabetically, and sorts lines by length.
  • Another participant emphasizes the importance of posting homework questions in the correct forum and outlines the forum's policy on providing help, indicating that participants should show their own work and analyses.
  • A participant shares a code snippet attempting to declare a character array for input but seeks clarification on how to enter names and manage input termination.
  • One participant mentions using Visual Studio 6.0, possibly indicating their development environment.
  • A brief inquiry is made about the whereabouts of another participant, suggesting a lack of engagement or response in the thread.

Areas of Agreement / Disagreement

Participants generally agree on the need for proper forum etiquette regarding homework questions, but the technical aspects of the programming task remain unresolved with multiple participants seeking clarification and assistance.

Contextual Notes

There are limitations in the clarity of the programming requirements, particularly regarding input handling and the specifics of the output format. The discussion also reflects varying levels of engagement and understanding among participants.

Who May Find This Useful

This discussion may be useful for students learning C++ programming, particularly those interested in string manipulation and input handling, as well as those seeking guidance on homework etiquette in online forums.

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
 

Similar threads

Replies
1
Views
3K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
1
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 14 ·
Replies
14
Views
4K
  • · Replies 15 ·
Replies
15
Views
3K
Replies
8
Views
2K
  • · Replies 5 ·
Replies
5
Views
4K