Skip to content

Amr4924/Smart-Calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧮 Smart Calculator V5.0 - Professional Modular Suite

GitHub stars GitHub forks GitHub issues License: Educational

LinkedIn TikTok C++ Platform


📋 Table of Contents


📖 Overview

Smart Calculator V5.0 is a comprehensive, modular C++ educational suite that provides advanced mathematical computations with professional code architecture. This version introduces optimized exit handling, enhanced modular design, and refined user experience, making it an excellent resource for learning modern C++ programming paradigms and professional software development practices.

🎯 Educational Objectives

  • Demonstrate advanced C++ programming with modular architecture
  • Showcase professional UI/UX design in console applications
  • Provide comprehensive mathematical operations for academic learning
  • Illustrate best practices in code organization and documentation

🆕 What's New in V5.0

🔧 Professional Code Architecture

  • Modular Exit System: Dedicated exit_program() function for clean code organization
  • 🎯 Enhanced Code Reusability: DRY (Don't Repeat Yourself) principle implementation
  • 📋 Optimized Function Management: Streamlined exit handling across different scenarios
  • 🎨 Professional Design Patterns: KISS (Keep It Simple, Stupid) methodology

🏗️ Architectural Refinements

  • 🔍 Function Separation: Clean separation of exit logic from main application flow
  • 📊 Code Maintainability: Improved code structure for easier maintenance and updates
  • 🧮 Professional Standards: Industry-standard programming practices implementation

User Experience Optimization

  • 📦 Consistent Exit Behavior: Unified exit experience across all program paths
  • 🔧 Streamlined Interface: Simplified user interaction with maintained functionality
  • 📚 Educational Value: Demonstrates advanced C++ modular programming concepts

⚡ Features

🔢 Core Mathematical Operations

Operation Description Features Examples
Basic Arithmetic Addition, Subtraction, Multiplication, Division Dynamic vector input, operation history 5 + 3 * 2 = 11
Exponentiation Power calculations with custom bases Integer bases, flexible exponents 2^8 = 256
Number Analysis Even/Odd classification Bulk processing, numbered input [2,4,6] → Even, [1,3,5] → Odd
Statistical Functions Average calculation Multiple number support, precision (2+4+6+8)/4 = 5.0
Factorial Computation Mathematical factorial Large number handling 5! = 120
Prime Number Testing Primality analysis Single or range testing 7 → Prime, 8 → Not Prime

📐 Advanced Geometric Calculations

  • Triangle Area Calculation
    • Basic Formula: Area = (base × height) / 2
    • Heron's Formula: Area = √(s(s-a)(s-b)(s-c)) where s = (a+b+c)/2
  • Triangle Perimeter: Perimeter = side₁ + side₂ + side₃
  • Multiple Methods: Choose between different calculation approaches

🔄 Comprehensive Unit Conversion

  • Length Conversions:
    • cm ⟷ m ⟷ km (bidirectional)
    • Precise conversion factors and calculations
  • Area Conversions:
    • cm² ⟷ m² ⟷ km² (comprehensive matrix)
    • Multi-step conversion support with accuracy

🎮 Interactive User Experience

  • Welcome System: Professional startup with program introduction
  • Menu Navigation: Intuitive numbered options with descriptions
  • Input Validation: Error handling and user guidance
  • Continuous Operation: Loop-based design for multiple calculations
  • Clean Interface: Organized output with clear formatting

🏗️ Architecture

📁 Project Structure

Smart-Calculator-V5.0/
│
├── 📄 main.cpp           # Enhanced UI & application logic
├── 📄 operations.h       # Comprehensive function declarations
├── 📄 operations.cpp     # Mathematical implementations (legacy)
├── 📄 LICENSE           # Educational use license
├── 📄 README.md         # Project documentation
└── 📁 .git/             # Version control

🔧 Technical Architecture

Component Technology Version Purpose
Language C++ 17+ Core implementation
UI System Console-based Custom Professional interface
Data Structures STL Vectors Dynamic Flexible input handling
Menu System Modular Functions Custom Organized navigation
Compiler Support GCC/Clang/MSVC 7.0+/6.0+/2017+ Cross-platform

🎯 Design Patterns

  • Modular Architecture: Separated UI and logic components
  • Function Overloading: Multiple menu display methods
  • Vector-Based Input: Dynamic memory management
  • Professional UI Design: Consistent formatting and layout

🚀 Quick Start

⚙️ Prerequisites

  • C++ Compiler: GCC 7.0+, Clang 6.0+, or MSVC 2017+
  • Command Line Interface: Terminal, Command Prompt, or PowerShell
  • System Requirements: Windows/Linux/macOS

📥 Installation

# 1. Clone the repository
git clone https://github.com/Amr4924/Simple-Cpp-Operations-Project.git

# 2. Navigate to project directory
cd Simple-Cpp-Operations-Project

# 3. Compile with C++17 standard
g++ -std=c++17 -o calculator main.cpp

# 4. Run the calculator
./calculator          # Linux/macOS
calculator.exe        # Windows

🔨 Compilation Options

# Debug build with full warnings
g++ -g -Wall -Wextra -Wpedantic -std=c++17 -o calculator_debug main.cpp

# Optimized release build
g++ -O3 -DNDEBUG -std=c++17 -o calculator_release main.cpp

# Windows with MinGW
g++ -std=c++17 -static -o calculator.exe main.cpp

💻 Installation

🖥️ Platform-Specific Instructions

Windows

# Using MinGW-w64
g++ -std=c++17 -o calculator.exe main.cpp

# Using Microsoft Visual Studio
cl /EHsc /std:c++17 main.cpp /Fe:calculator.exe

Linux (Ubuntu/Debian)

# Install build tools
sudo apt update && sudo apt install build-essential

# Compile
g++ -std=c++17 -o calculator main.cpp

macOS

# Install Xcode Command Line Tools
xcode-select --install

# Compile with Clang
clang++ -std=c++17 -o calculator main.cpp

📚 Usage Guide

🎮 Application Flow

  1. Welcome Screen: Choose to start ([1]) or exit ([0])
  2. Main Menu: Select from 8 mathematical operations
  3. Operation Selection: Each operation provides:
    • Detailed description with mathematical explanation
    • Practical examples
    • Step-by-step input guidance
  4. Result Display: Clear, formatted output
  5. Continue Options: Choose to perform another calculation or exit

🔢 Available Operations

Operation Menu Option Description
Basic Arithmetic [1] Dynamic arithmetic with multiple operations
Exponentiation [2] Power calculations with base and exponent
Even/Odd Analysis [3] Bulk number classification
Average Calculation [4] Statistical mean of multiple numbers
Factorial [5] Mathematical factorial computation
Triangle Geometry [6] Area and perimeter calculations
Unit Conversion [7] Length and area unit transformations
Prime Numbers [8] Primality testing and analysis

🧪 Examples

🔢 Basic Arithmetic

Operation: Basic Arithmetic
Input: Dynamic number and operator entry
Process: Vector-based calculation with operation history
Output: Final computed result

📐 Triangle Area (Heron's Formula)

Input: Three sides (a=3, b=4, c=5)
Process: 
  s = (3+4+5)/2 = 6
  Area = √[6(6-3)(6-4)(6-5)] = √[6×3×2×1] = 6
Output: Area = 6.00 square units

🔍 Prime Number Analysis

Single Number Test:
Input: 17
Output: ✅ 17 is a PRIME number!

Range Analysis:
Input: Range [10-20]
Output: 
  ✅ PRIME: 11, 13, 17, 19 (4 primes)
  ❌ NON-PRIME: 10, 12, 14, 15, 16, 18, 20 (7 non-primes)

🔄 Unit Conversion

Length Conversion:
Input: 1500 cm → m
Process: 1500 ÷ 100 = 15
Output: 15.00 meters

Area Conversion:
Input: 5 m² → cm²
Process: 5 × 10,000 = 50,000
Output: 50,000.00 cm²

📈 Version History

Version Release Date Key Features Status
V5.0 September 2025 Professional Code Architecture, Modular Exit System Current
V4.5 August 2025 Enhanced UI, Prime Numbers, Professional Menus 📦 Archived
V3.5 Previous Modular architecture, header organization 📦 Archived
V3.0 Previous Triangle geometry, unit conversion systems 📦 Archived
V2.0 Previous Enhanced arithmetic, operation history 📦 Archived
V1.0 Initial Basic calculator functionality 📦 Archived

🆕 V5.0 Major Updates

  • Modular Exit System: Dedicated exit_program() function for clean architecture
  • Professional Code Design: Implementation of DRY and KISS principles
  • Enhanced Maintainability: Improved code structure and organization
  • Optimized Function Management: Streamlined exit handling across scenarios
  • Industry Standards: Professional programming practices demonstration
  • Code Reusability: Elimination of code duplication with modular functions

🛠️ Development Features

🏗️ Advanced Code Architecture

  • Modular Menu System: Separated UI components (Welcome, SubMenu, MenuConvert)
  • Professional Documentation: Comprehensive function comments with examples
  • STL Integration: Modern C++ with vector containers and algorithms
  • Error Handling: Input validation and user guidance systems

🎨 User Interface Excellence

  • Consistent Formatting: Professional borders and organized layout
  • Interactive Navigation: Numbered options with clear descriptions
  • Educational Content: Operation explanations with mathematical examples
  • Visual Feedback: Organized output with formatted results

Performance Optimizations

  • Efficient Algorithms: Optimized mathematical computations
  • Dynamic Memory Management: Vector-based data structures
  • Cross-Platform Compatibility: Support for major operating systems
  • Modular Design: Clean separation of concerns for maintainability

🤝 Contributing

We welcome educational contributions! Here's how to get involved:

🔄 Contribution Process

  1. 🍴 Fork the repository
  2. 🌿 Create a feature branch (git checkout -b feature/educational-enhancement)
  3. 💾 Commit changes (git commit -m 'Add educational feature')
  4. 🚀 Push to branch (git push origin feature/educational-enhancement)
  5. 📬 Open a Pull Request

📋 Development Guidelines

Code Standards

  • Follow C++17 standards and modern practices
  • Use consistent naming conventions and code formatting
  • Include comprehensive comments for educational value
  • Maintain modular architecture for menu and calculation functions

🧪 Testing Requirements

  • Test across multiple platforms (Windows/Linux/macOS)
  • Verify compilation with different compilers
  • Ensure no regression in existing functionality
  • Validate user interface consistency and usability

📚 Documentation Standards

  • Update README.md for new features
  • Include operation descriptions with mathematical explanations
  • Provide usage examples and educational context
  • Maintain architectural documentation for future developers

📝 License

This project is licensed under the MIT License - Educational Use Only.

⚖️ License Terms Overview

Usage Type Permission Description
🎓 Educational Allowed Learning, academic projects, skill development
🏫 Academic Allowed University assignments, research projects
👨‍💻 Personal Learning Allowed Individual skill building, portfolio development
🌐 Open Source Allowed Contributing to educational repositories
💼 Commercial Prohibited Selling, profit generation, commercial use
🏭 Enterprise Prohibited Corporate use without explicit permission

📄 Complete License Information

For full license terms and conditions, see the LICENSE file.

Commercial Licensing: For commercial use inquiries, contact through LinkedIn.


📧 Contact

👨‍💻 Developer

Amr Sa3dwy - Lead Developer & Educational Architect

🌐 Connect & Follow

Platform Profile Purpose
💻 GitHub @Amr4924 Source code & project repositories
💼 LinkedIn Amr Sa3dwy Professional networking & collaboration
🎥 TikTok @3mr675 Programming tutorials & educational content

💌 Get In Touch

Feel free to contact for:

  • Questions about implementation or usage
  • 💡 Suggestions for educational improvements
  • 🤝 Collaboration on educational projects
  • 🎓 Academic discussions and learning opportunities
  • 🐛 Bug reports or technical issues

🙏 Acknowledgments

🏆 Educational Community

  • C++ Programming Community: For modern programming standards and best practices
  • Educational Open Source Contributors: Supporting knowledge sharing and collaborative learning
  • Mathematical Computing Enthusiasts: For algorithmic inspiration and computational methods
  • UI/UX Design Principles: For professional interface design in console applications

🎯 Project Impact

This project demonstrates:

  • Modern C++ Development: Industry-standard practices with modular architecture and clean code principles
  • Professional Software Engineering: Implementation of DRY, KISS, and modular design patterns
  • Educational Software Design: User-friendly interfaces optimized for learning environments
  • Mathematical Computing: Practical application of algorithms with professional code organization
  • Code Maintainability: Advanced techniques for sustainable and scalable software development

Star this repository if it helped your learning journey!

Proudly supporting programming education worldwide 🌍

GitHub stars


© 2025 Amr Sa3dwy. Licensed for Educational Use Only.

Version 5.0 - Professional Modular Suite with Advanced Architecture

About

A simple C++ program that demonstrates basic operations (power, even/odd, average).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages