ChicoState / ChicoState/tally

Constrain program to 1-99 parties

Open Beginner friendly
#2 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
0
Forks
4
PR merge metrics
No merged PRs in 30d

Description

Currently, the program allows the user to tally for one party by default by just running:

```
./tally
```

and then entering `1` for each tally for that party. However, it also supports entering an argument of the number of parties, such as:

```
./tally 3
```

and then entering values `1` or `2` or `3` to tally for those respective parties.

**However** we want to constrain this argument so that any value given for `argv` that is provided that is *outside* of the range **1 to 99**, instead of running the tallying process, it should just print the error message:

```
usage: ./tally []
- number of parties to tally (1-99). Default = 1.
```

and then terminate the program.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the program entry point that reads argv and trace how the party count is parsed before tallying begins. Check the existing ./tally and ./tally 3 behavior, then verify that values below 1 or above 99 print the specified usage message and terminate without tallying.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.