Invalid-input hint omits the history and clear commands

Open Beginner friendly
#25 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
csharp
Domain
cli

Research direction

Open Program.cs and find the default case of the operator switch around line 243. Read the invalid input hint and the README command table, then include the history and clear commands in the hint. Done when a misspelled command produces a hint that lists both commands.

Written by the indexing model from the issue text.

Description

bug good first issue

The "Invalid input" hint (Program.cs, default case of the operator switch, line 243) reads:

Invalid input. The possible inputs were: Add (+), Subtract (-), Multiply (*), Divide (/), Power (^), Modulo (%), or Exit (exit).

It lists every operator and the exit keyword, but not the history and clear command words added in #19 and #23. A user who mistypes a command (e.g. histroy) is shown a list of "possible inputs" in which the two commands they just used don't exist — the hint actively contradicts the README's command table.

Suggested fix: append the commands to the message, e.g. "... Modulo (%), History (history), Clear (clear), or Exit (exit)."

A smoke test could feed a deliberately misspelled command (e.g. histroy) and assert the printed hint mentions both history and clear.

Dominant language
C#
Stars
0
Forks
0
Avg merge
1h 12m
Merged PRs (30d)
4

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

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 billyx86/CSharp-SimpleCalculator

All issues in billyx86/CSharp-SimpleCalculator

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.