Mini Project #1 - Simple Calculator

You have now learned most of the C# basics. It is time to apply this theory into an actual project. Create a simple command-line calculator that allows users to perform basic arithmetic operations (addition, subtraction, multiplication, and division) on two numbers.

Key Features

  • Display a menu for the user to select an operation (e.g., addition, subtraction, multiplication, division).
  • Prompt the user to enter two numbers.
  • Perform the selected operation on the numbers.
  • Display the result to the user.
  • Ask the user if they want to perform another calculation.
  • Here is some sample implementation of the calculator console application

    Welcome to Simple Calculator
    
    Menu:
    1. Addition
    2. Subtraction
    3. Multiplication
    4. Division
    5. Exit
    
    Please select an operation (1-5): 1
    Enter the first number: 5
    Enter the second number: 3
    Result: 5 + 3 = 8
    
    Perform another calculation? (Y/N): Y
    
    Menu:
    1. Addition
    2. Subtraction
    3. Multiplication
    4. Division
    5. Exit
    
    Please select an operation (1-5): 4
    Enter the first number: 10
    Enter the second number: 0
    Error: Division by zero is not allowed.
    
    Perform another calculation? (Y/N): N
    
    Goodbye!

    I encourage you to add more to this project. There any more mathematical operations that you could add to this project. Do not try and get this done as quickly as possible or google an answer. Try and learn as much as you can from it. At the same time, do not get frustrated if you do not understand what to do. Make sure to ask for help and google if you get really frustrated.

    If you completed this project with no struggle and need more of a challenge, here is some functionality you can add that is a little bit more challenging. I have not gone over everything in the list below

  • For addition and multiplication, allow the user to input as many numbers as they would like.
  • Exponents
  • Give the remainder of division if it's not 0
  • Next Section: Classes and Objects