How faridacherifch-source/simple-calculator works
A small interactive C++ calculator: the user selects an operation, enters values through the console, and receives a printed result. The single source file implements arithmetic, power, roots, trigonometry, logarithms, and two derivative approaches. The operation nodes represent branches within main, not separate modules; the derivative estimate additionally calls f.
Main entry points: simple_calculator.cpp Menu loop
Components 10
Other components
- User
- Console
- Menu loop
simple_calculator.cpp - Basic arithmetic
simple_calculator.cpp - Power
simple_calculator.cpp - Roots
simple_calculator.cpp - Trigonometry
simple_calculator.cpp - Logarithms
simple_calculator.cpp - Derivatives
simple_calculator.cpp - Square function
simple_calculator.cpp
Connections 16
- User → Console: enters choices
- Menu loop → Console: prompts and reads
- Console → Menu loop: supplies input
- Menu loop → Basic arithmetic: selects branch
- Menu loop → Power: selects branch
- Menu loop → Roots: selects branch
- Menu loop → Trigonometry: selects branch
- Menu loop → Logarithms: selects branch
- Menu loop → Derivatives: selects branch
- Basic arithmetic → Console: prints result
- Power → Console: prints result
- Roots → Console: prints result
- Trigonometry → Console: prints result
- Logarithms → Console: prints result
- Derivatives → Console: prints result
- Derivatives → Square function: evaluates function