This repository contains four progressively challenging C++ exercises built around the following topics:
- C++ Header files & Operators
- C++ Reference Variables & Typecasting
- Constants, Manipulators & Operator Precedence
- Control Structures (If-Else and Switch-Case)
- Loops (For, While, and Do-While)
-
Question1: Temperature Converter
- Fill-in-the-blanks exercise
- Focus: operators, type casting, basic I/O formatting
- Practice with number conversions and decimal formatting
-
Question2: Grade Calculator
- Fill-in-the-blanks exercise
- Focus: if-else statements, input validation
- Calculate grades based on marks using conditions
-
Question3: Number Pattern Generator
- Fill-in-the-blanks exercise
- Focus: nested loops, pattern printing
- Create different number patterns using loops and spacing
-
Question4: Simple Calculator
- Fill-in-the-blanks exercise
- Focus: switch-case, menu system, error handling
- Implement multiple mathematical operations with proper validation
Each question is in its own folder (Question1/, Question2/, etc.) and contains:
qX.cpp— Template file with TODO comments marking where to add codeREADME.md— Detailed instructions, expected output, and requirements
# compile
g++ -std=c++17 Question1/q1.cpp -o Question1/q1
g++ -std=c++17 Question2/q2.cpp -o Question2/q2
g++ -std=c++17 Question3/q3.cpp -o Question3/q3
g++ -std=c++17 Question4/q4.cpp -o Question4/q4
# run
./Question1/q1
./Question2/q2
./Question3/q3
./Question4/q4- Complete all TODO sections in each question's cpp file
- Make sure each program:
- Compiles without errors
- Produces exactly the expected output
- Handles invalid inputs appropriately
- Is well-commented and readable
-
Correctness (40%)
- Programs compile and run without errors
- Output matches the expected format exactly
- Proper handling of invalid inputs
-
Code Quality (30%)
- Clear and meaningful variable names
- Proper indentation and formatting
- Helpful comments explaining logic
-
Concept Understanding (30%)
- Proper use of control structures
- Appropriate type casting and operators
- Efficient loop implementations
- Proper error handling
- Read the main README (this file) completely
- Go through each question's README for specific requirements
- Start with Question1 and progress in order
- Test thoroughly with sample inputs before submitting
Remember: The goal is to understand and practice fundamental C++ concepts. Take your time to understand each concept before implementing.