C# Projects
1. Simple Interest
Where: Formula – I = P × r × t
I is the simple interest.
P is the principal amount (the initial amount of money).
r is the annual interest rate (decimal).
t is the time the money is invested for, in years.
Example Usage
If the user enters:
Principal amount (P): 1000
Annual interest rate (r): 5%
Number of years (t): 3
The program will calculate and display:
The simple interest is: 150.00
The total amount after 3 years is: 1150.00
2. How to find the Biggest Number from the User Given array
Example Usage
If the user inputs:
• Number of elements: 5
• Element 1: 10
• Element 2: 25
• Element 3: 7
• Element 4: 30
• Element 5: 15
The program will output:
The elements of the array are:
10
25
7
30
15
The largest number in the array is: 30
3. Give an Example for the below operators.
4. Give an Example for the below Math Class :
5. Give an Example for the Below array methods.
6. Determine if the user-given number is prime (a number that can only be divided by 1 and itself ) like below.
7. Create a console application where users can manage their to-do list by using a collection of List.
8. Implement a Simple Calculator
- Write a console application that takes two numbers and an operator (+, -, *, /) from the user and performs the corresponding operation.
- Use switch statements to handle the different operations.
- Ensure proper validation and error handling for invalid input or division by zero.
9. Implement a Simple Number Guessing Game
- Write a console application that generates a random number between 1 and 100 by using the random method of math class
- Use a while loop to allow the user to guess the number until they get it right.
- Provide feedback to the user whether their guess is too high or too low.
10. Abstract Class and Inheritance
- Create an abstract class Shape with an abstract method Area().
- Implement derived classes Circle and Rectangle that calculate the area of the respective shapes.
- Write a console application that creates instances of Circle and Rectangle, sets their dimensions, and displays their areas.
- Formula for circle – Math.PI * Radius * Radius;
- Formula for rectangle – Width * Height;
11. Compound Interest Calculation
Create a C# program to calculate the compound interest on a principal amount. The user should be able to input the principal amount, annual interest rate, number of times interest is compounded per year, and the number of years. Implement a method that calculates the compound interest and another method that displays the results.
Requirements:
1. Create a method to calculate compound interest using the formula:
where:
Formula
o A is the amount of money accumulated after n years, including interest.
o P is the principal amount (the initial sum of money).
o r is the annual interest rate (decimal).
o n is the number of times that interest is compounded per year.
o t is the number of years the money is invested for.
2. Create a method to display the results.
3. Allow the user to input values for P, r, n, and t and use the methods to calculate and display the compound interest.
Example Usage
When you run the program, it will prompt you to enter the following:
• Principal amount (P)
• Annual interest rate (r) (as a decimal, e.g., 0.05 for 5%)
• Number of times interest is compounded per year (n)
• Number of years the money is invested for (t)
For example:
• Principal amount (P): 1000
• Annual interest rate (r): 0.05
• Number of times interest is compounded per year (n): 4
• Number of years the money is invested for (t): 5
12. Bank Account Management System
Create a bank account management system using encapsulation and abstraction. The system should allow users to create accounts, deposit money, withdraw money, and check balances.
Requirements:
- Encapsulate the account balance.
- Abstract the operations into an interface.
- Implement the interface in a concrete class.
Like below