This C# code is a console application that encompasses various functionalities, including arithmetic operations, string manipulations, exception handling, and implementations of mathematical concepts. It also features object-oriented programming with classes and interfaces, demonstrating the use of shapes, complex numbers, and stack operations.
- [Arithmetic Operations]
- [Check Armstrong Number]
- [Find Substrings]
- [Divide by Zero Exception]
- [Pascal's Triangle]
- [Floyd's Triangle]
- [Read File]
- [Stack Operations]
- [Complex Number Operations]
- [Shapes Drawing and Erasing]
- [Shapes Area and Perimeter]
- [Resize Rectangle]
-
Arithmetic Operations
- Accepts two numbers and performs basic arithmetic operations such as addition, subtraction, multiplication, division, modulus, exponentiation, and exponential.
-
Check Armstrong Number
- Validates whether a given number is an Armstrong number.
-
Find Substrings
- Takes a user input string and prints all possible substrings.
-
Divide by Zero Exception
- Demonstrates a try-catch block for handling a DivideByZeroException.
-
Pascal's Triangle
- Generates and prints Pascal's Triangle based on the user-specified number of rows.
-
Floyd's Triangle
- Generates and prints Floyd's Triangle based on the user-specified number of rows.
-
Read File
- Reads and displays the content of a text file using different approaches, such as
File.ReadAllText()
,File.ReadAllLines()
, andStreamReader
.
- Reads and displays the content of a text file using different approaches, such as
-
Stack Operations
- Implements a basic stack with operations like push, pop, peek, and display.
-
Complex Number Operations
- Takes two complex numbers as input, performs addition, and displays the result.
-
Shapes Drawing and Erasing
- Illustrates polymorphism by drawing and erasing various shapes (Circle, Triangle, Square, Rectangle).
-
Shapes Area and Perimeter
- Calculates and displays the area and perimeter of different shapes (Circle, Triangle, Square, Rectangle).
-
Resize Rectangle
- Allows the user to create a rectangle and then resize it by changing its width and height.
- Execute the
Main()
method in theProgram
class to start the program. - Choose from the menu options by entering the corresponding number.
- The program is structured using object-oriented principles, demonstrating the use of classes, interfaces, and inheritance.
- Some functionalities may prompt for user input, so follow the on-screen instructions.