You are viewing a single comment's thread from:

RE: Steemit Learning Club S23W2:Creating quizzes and viewing quiz scores with C++ programs.

Thank you @mahadisalim for your efforts, I like your eagerness to learn development, I noticed you've incorporated some of my previous remarks like variable naming and Git usage, let's go through some suggestions for improvement:

Testing multiple scenarios

  • The program working correctly for one test case doesn't mean it works well for all cases, you should test many examples, not just the happy path.
  • Even the best programs will have bugs , that's why the term "bug" exists in programming, good developers test extensively across different scenarios.
  • Try testing with invalid inputs, boundary cases, and unexpected user behavior to make your program more robust.

Input validation.

  • The program could crash if a user enters a letter instead of a number. There no validation to ensure users only input numbers between 1 and 4 .

Code modularity.

  • with only 3 questions ==> the code is manageable, but imagine having 100 questions ==> The code would become very lengthy and difficult to maintain.
  • Consider using functions to make your code more modular , example: create a function for asking questions that can be reused.

Program expandability.

  • If you want to add new questions, you currently need to modify the source code directly, recompile, and run again.
  • A better approach would be to create a function that can add new questions dynamically or read questions from an external file.

GitHub.

  • I think you are uploading your work to GitHub manually instead of using Git commands, I encourage you to learn about Git commands like git add, git commit, and git push.
    Learning these commands will make your workflow more efficient, and they are easy to work with, they will enhance your skills

You work is clear, and the examples you provide are easy to understand. It's good for beginners to learn, also, I see you worked in a C++ editor instead of an online editor, which is great. Keep going, brother

Sort:  

Thanks sir, for showing me the updated topics of C++ program. I'm a new user on GitHub so I did it manually. But I will learn about the three things you mentioned on GitHub. Later, I will add the program codes to GitHub. You are right I need smarter coding knowledge to add a hundred quizzes. I will learn about it.

Coin Marketplace

STEEM 0.15
TRX 0.23
JST 0.032
BTC 83993.63
ETH 2328.45
USDT 1.00
SBD 0.68