Inspiration
i wanted to build my first C++ that actually compiles, runs in the terminal, and does'nt crash. No tutorials, just me vs the compiler
What it does
A C++ console Calculator that handles: -Addition, Subtraction, Multiplication, Division -Divide-by-zero error handling so it doesn't crash -Separate function for each operation
How I built it
Stack:C++, g++, VS Code, TERMINAL wrote separate functions for each operation, then called them in ' main()'with the menu. compiled with' g++ calculator_app.cpp -o calc'
Challenges I ran into
1.'cout >> ' vs 'cout << '-arrows matter 2.'undefined reference'-forgot to define my functions 3.printing'op'as text-learned variables vs strings
Accomplishments that I'm proud of
got my first program to compile AND run without crashing . Added error handling for diving by zero. went from 0 files to 3 files on Github.
What I learned
how to split code into function, how compiler errors actually tell you what's wrong , the difference between variables and strings
What's next for C++ console calculator
Add a loop sothat you don't restart the program. Add modulus '%' and exponents'^'. Maybe a GUI version later.
status :compile junkie certifield
Log in or sign up for Devpost to join the conversation.