Fork, Commit, Merge - Medium Issue 2 (C++)

Open Beginner friendly
#8,531 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
85/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
cpp
Domain
cli

Research direction

Start in tasks/c++/medium/text_file_parser/TextFileParser.cpp, and read the issue's requirements and example. The program should open input.txt from the working directory, lowercase words, skip a stop-word list, count frequencies, and sort by count. Build with g++ -o TextFileParser TextFileParser.cpp from that directory, then run ./TextFileParser. It is done when the example input prints the listed words with their counts, most frequent first. The issue does not say how ties should be ordered, so pick a rule and state it in the pull request.

Written by the indexing model from the issue text.

Description

c++ first-contributor first-contributors good first issue help wanted medium up-for-grabs

Fork, Commit, Merge - Medium Issue 2 (C++)

Implement a Basic Text File Parser

Note: You don't have ask permission to start solving the issue or get assigned, since these issues are supposed to be always open for new contributors. The actions-user bot will reset the file back to previous state for the next contributor after your commit is merged. So you can just simply start working with the issue right away!

Navigate to the tasks/c++/medium/text_file_parser directory from the root of your project.
Open the TextFileParser.cpp file and start implementing your solution!

cpp-medium-text-file-parser

Description:

Create a C++ program that reads a text file and counts the frequency of each word in the file. The program should then output each word along with its corresponding count to the console, sorted by the most frequent words first.

Requirements:
  • Read a file named input.txt.
  • Ignore case (e.g., "The" and "the" are considered the same word).
  • Exclude common English stop words (e.g., "the", "is", "at", "which", "on").
  • Use standard C++ libraries only.
Example:

Given input.txt:

Hello world!
The world is a beautiful place.
The weather is wonderful.

Output should be:

world - 2
beautiful - 1
place - 1
weather - 1
wonderful - 1
hello - 1
Compiling and Running:

To test the program you have to first make sure you are in the right directory:

cd tasks/c++/medium/text_file_parser

Then compile the files:

g++ -o TextFileParser TextFileParser.cpp

Then you can run the compiled program by running:

./TextFileParser

If the program works as requested in the task, you are ready to make a pull request!


To work with this issue, you need to have C++ installed to your local machine.
Check out README.md for more instructions of installing C++ and how to make a pull request.

Feel free to ask any questions here if you have some problems!

Also, kindly give this project a star to enhance its visibility for new developers!
Dominant language
CSS
Stars
511
Forks
2.6k
Avg merge
19h 9m
Merged PRs (30d)
94

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from fork-commit-merge/fork-commit-merge

All issues in fork-commit-merge/fork-commit-merge

Similar issues

More CLI issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.