- Getting Started
- Set Operations System
- Rocket Velocity Calculator
- Investment Growth Calculator
- Troubleshooting
- Advanced Usage
- Operating System: Windows 10+, macOS 10.15+, or Linux (Ubuntu 18.04+)
- .NET Runtime: .NET 8.0 or later
- Memory: At least 512MB RAM
- Storage: 100MB free space
- Visit https://dotnet.microsoft.com/download
- Download .NET 8.0 Runtime for your operating system
- Run the installer and follow the prompts
- Verify installation by opening a terminal/command prompt and typing:
You should see:
dotnet --version
8.0.x
git clone https://github.com/NickiMash17/CSharpPracticalProjects.git
cd CSharpPracticalProjectsdotnet buildYou should see: Build succeeded.
The Set Operations System analyzes student enrollment in two courses using mathematical set theory. It computes:
- Union: Students in either course
- Intersection: Students in both courses
- Complements: Students not in each course
cd SetOperationsSystem
dotnet runStep 1: Enter Universal Set
Enter the universal set U (all registered students):
Enter student IDs separated by spaces (e.g., 1001 1002 1003):
Type: 1001 1002 1003 1004 1005 1006 1007 1008
Press: Enter
Step 2: Enter Course A Students
Enter students enrolled in Course A:
Enter student IDs separated by spaces:
Type: 1001 1002 1003 1004
Press: Enter
Step 3: Enter Course B Students
Enter students enrolled in Course B:
Enter student IDs separated by spaces:
Type: 1003 1004 1005 1006
Press: Enter
=== Input Sets ===
Universal Set U = {1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008}
Set A (Course A) = {1001, 1002, 1003, 1004}
Set B (Course B) = {1003, 1004, 1005, 1006}
=== Set Operation Results ===
Union of A and B (students in either course) = {1001, 1002, 1003, 1004, 1005, 1006}
Intersection of A and B (students in both courses) = {1003, 1004}
Complement of A (students not in Course A) = {1005, 1006, 1007, 1008}
Complement of B (students not in Course B) = {1001, 1002, 1007, 1008}
- ✅ Valid: Student IDs as integers separated by spaces
- ❌ Invalid: Empty input, duplicate IDs, IDs not in universal set
- 📝 Format: Numbers separated by single spaces
The Rocket Velocity Calculator computes rocket velocity and position at t = 2 seconds using specific physics formulas:
- Velocity: v(t) = 3t² meters per second
- Position: s(t) = t³ meters
cd RocketVelocityCalculator
dotnet runThe application runs automatically and shows:
Step-by-Step Calculations:
Step a: Time t is set to 2 seconds
Step b: Velocity calculation: v = 3 × 2² = 12 m/s
Step c: Position calculation: s = 2³ = 8 meters
Formatted Output:
At t=2 seconds, velocity is 12 m/s and position is 8 meters.
Data Type Information:
Time (t): Double = 2
Velocity (v): Double = 12
Position (s): Double = 8
Error Handling Demo:
✓ Error handling works: Time -1 is invalid (negative)
This application runs automatically and demonstrates:
- ✅ Mathematical calculations
- ✅ Proper output formatting
- ✅ Error handling
- ✅ Data type usage
- ✅ Code commenting
The Investment Growth Calculator models continuous compound interest using the formula A = P × e^(rt). It:
- Calculates investment growth over time
- Displays results in a formatted table
- Provides growth analysis
- Offers file export functionality
cd InvestmentGrowthCalculator
dotnet runStep 1: Principal Amount
Principal (P) - Initial investment amount ($): 1000
Type: 1000 (for $1,000 investment)
Press: Enter
Step 2: Interest Rate
Interest Rate (r) - Annual rate as decimal (e.g., 0.05 for 5%): 0.05
Type: 0.05 (for 5% annual growth)
Press: Enter
Step 3: Start Time
Start Time (t) - Beginning of time range (years): 0
Type: 0 (start from beginning)
Press: Enter
Step 4: End Time
End Time (t) - End of time range (years): 5
Type: 5 (5-year analysis period)
Press: Enter
Step 5: Step Size
Step Size - Time increment (years): 1
Type: 1 (yearly increments)
Press: Enter
Investment Growth Table:
=== Investment Growth Table ===
Time (years) Investment Value ($)
----------------------------------------
0.00 $1000.00
1.00 $1051.27
2.00 $1105.17
3.00 $1161.83
4.00 $1221.40
5.00 $1284.03
Investment Analysis:
=== Investment Analysis ===
Initial Investment: $1000.00
Interest Rate: 5.00%
Final Value: $1284.03
Percentage Change: 28.40%
Growth Trend: Investment is growing
File Export Option:
Would you like to save the results to a file? (y/n): y
✓ Results saved to InvestmentGrowth.txt
- ✅ Principal: Must be positive (> 0)
- ✅ Interest Rate: Can be positive (growth) or negative (depreciation)
- ✅ Time Range: Start < End, both non-negative
- ✅ Step Size: Must be positive and reasonable
Error: Could not find a part of the path
Solution: Ensure you're in the correct directory
pwd # Check current directory
cd CSharpPracticalProjects # Navigate to project rootError: The framework 'Microsoft.NETCore.App', version '6.0.0' was not found
Solution: Update project files to .NET 8.0 or install .NET 6.0
# Check installed .NET versions
dotnet --list-runtimes
# Install .NET 8.0 if needed
# Visit: https://dotnet.microsoft.com/downloadError: Cannot read keys when console input is redirected
Solution: This is normal when running with piped input. The application still works correctly.
Error: Input string was not in a correct format
Solution: Ensure you're entering valid numbers
- Use decimal points (e.g.,
0.05not5%) - Don't include currency symbols
- Use spaces to separate multiple numbers
Error: Access to the path is denied
Solution: Check file permissions and directory access
# On Linux/Mac, check permissions
ls -la
# On Windows, run as administrator if needed- Check the individual project README files for detailed guides
- Verify .NET installation:
dotnet --version - Check project structure: Ensure all files are present
- Review error messages: They often contain specific solutions
You can modify the Program.cs file to:
- Change input prompts
- Add new validation rules
- Modify output formatting
- Add new set operations
You can modify the time value in Program.cs:
// Change this line to test different times
double time = 3.0; // Instead of 2.0You can modify the FinancialCalculationService.cs to:
- Add new financial formulas
- Change output formats
- Add new analysis features
- Modify file export options
# Build all projects
dotnet build
# Run all projects in sequence
cd SetOperationsSystem && dotnet run && cd ..
cd RocketVelocityCalculator && dotnet run && cd ..
cd InvestmentGrowthCalculator && dotnet run && cd ..Create a test script to validate all projects:
#!/bin/bash
echo "Testing Set Operations System..."
cd SetOperationsSystem
echo "1001 1002 1003 1004 1005 1006 1007 1008" | dotnet run
cd ..
echo "Testing Rocket Velocity Calculator..."
cd RocketVelocityCalculator
dotnet run
cd ..
echo "Testing Investment Growth Calculator..."
cd InvestmentGrowthCalculator
echo -e "1000\n0.05\n0\n5\n1" | dotnet run
cd ..- Open the project folder in VS Code
- Install C# extension
- Use integrated terminal for running projects
- Use debugging features for step-by-step execution
- Open
CSharpPracticalProjects.sln - Set startup project
- Use debugging tools
- Use IntelliSense for code completion
- Set Theory: Khan Academy Set Theory
- Physics Formulas: Physics Classroom
- Financial Mathematics: Investopedia Compound Interest
- Microsoft Learn: C# Fundamentals
- YouTube: Search for "C# Console Applications Tutorial"
- Books: "C# in Depth" by Jon Skeet
- Official Documentation: .NET Documentation
- Community: Stack Overflow C# Tag
- Understand the Requirements: Read each project specification carefully
- Test with Sample Data: Use the provided examples to verify your understanding
- Document Your Learning: Take notes on mathematical concepts and C# features
- Practice Modifications: Try changing parameters and observe results
- Seek Help Early: Don't wait until the deadline to ask questions
- Use as Teaching Tools: These projects demonstrate real-world applications
- Assign Modifications: Ask students to extend functionality
- Group Projects: Combine multiple projects for comprehensive assignments
- Assessment: Use the built-in validation and error handling for grading
- 📖 Documentation: Check individual project README files
- 🐛 Issues: Report bugs on GitHub
- 💡 Discussions: Start conversations about improvements
- 📧 Contact: Reach out to the author
We welcome contributions! Here's how:
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
- ⭐ Star the repository for updates
- 🔔 Watch for notifications
- 📢 Share with fellow students and developers
# Build all projects
dotnet build
# Run Set Operations System
cd SetOperationsSystem && dotnet run
# Run Rocket Velocity Calculator
cd RocketVelocityCalculator && dotnet run
# Run Investment Growth Calculator
cd InvestmentGrowthCalculator && dotnet run- Set Operations:
1001 1002 1003 1004 1005 1006 1007 1008 - Investment Calculator:
1000→0.05→0→5→1
- Set Operations: Union, Intersection, Complements
- Rocket Calculator: v=12 m/s, s=8 meters
- Investment Calculator: Growth table and analysis
Happy Learning and Coding! 🚀📚💻
This guide covers all three C# Mathematical Applications projects. Each project is designed to be educational, practical, and ready for academic use.