Assignment Overview
In this assignment, you will build a Multi-Function Calculator with an interactive menu system. This project requires you to apply ALL concepts from Module 2: operators, conditionals, and all types of loops to create a professional, user-friendly application.
iostream, iomanip, cmath, limits).
No external libraries or platform-specific headers allowed.
Operators (2.1)
Arithmetic, relational, logical operators
Conditionals (2.2)
if-else, switch-case statements
Loops (2.3)
for, while, do-while, break/continue
The Scenario
MathWiz Software Solutions
You have been hired as a Junior C++ Developer at MathWiz Software Solutions. Your first project is to create a multi-function calculator for their educational software suite.
"We need a calculator that's more than basic arithmetic. It should have multiple modes - basic math, scientific calculations, number theory tools, and pattern generators. Make sure it handles invalid inputs gracefully!"
Requirements
Main Menu System
Create a do-while loop menu with switch-case for: Basic Arithmetic, Scientific Calculator, Number Theory, Pattern Generator, Exit.
Basic Arithmetic Mode
Implement +, -, *, /, modulus, and power calculation (using loop). Handle division by zero.
Scientific Calculator
Square root, logarithm (base 10 & natural), trigonometric functions (degree input), factorial using for loop.
Number Theory Tools
Prime check, find primes up to N, palindrome check, GCD (Euclidean algorithm), Fibonacci sequence.
Pattern Generator
Right triangle, inverted triangle, number pyramid, diamond pattern using nested loops.
Input Validation
Validate ALL inputs using while loops. Use cin.clear() and cin.ignore() for error handling.
Submission
Required Repository Name
cpp-menu-calculator
cpp-menu-calculator/
├── calculator.cpp # Main C++ source file
├── sample_output.txt # Sample output
└── README.md # Documentation
Grading Rubric
| Criteria | Points |
|---|---|
| Main Menu System (do-while, switch) | 20 |
| Basic Arithmetic | 25 |
| Scientific Calculator | 25 |
| Number Theory Tools | 35 |
| Pattern Generator (4 patterns) | 30 |
| Input Validation | 20 |
| Code Quality | 20 |
| Total | 175 |