Learn to use AI prompts to make controlled changes to C++ programs, improve readability, and understand each modification.
Use AI to explore how a program can be changed while keeping control of the code and understanding every edit. Start with a working program, make one change at a time, and run it after each change.
I am a beginner learning [programming language]. Help me change the program below so it [describe one specific change]. First explain which part should change and why. Give me a hint so I can try it myself. Do not rewrite the whole program.
Program:
[Paste your code here]
Review this program for readability without changing what it does. Suggest one improvement at a time, explain the benefit in beginner-friendly language, and wait for me to approve each change before rewriting the code.
Program:
[Paste your code here]
Compare my original program with the modified version. List the changes, explain how each change affects the program, and tell me what tests I should run to check that the behavior is still correct.
Original: [Paste the original code]
Modified: [Paste the updated code]