C# Algorithm #1 – Sum 2 Int’s

C# Algorithm #1 – Sum 2 Int’s

In this video, we will walk through a simple C# Algorithm example where you take 2 numbers and calculate their sum. If both values are the same however, you need to triple the sum and return that instead. 

We also learn about the Ternary operator and how to utilize it to shrink down bulky If statements in code. 

Installing Visual Studio

Installing Visual Studio



In this tutorial, we are going to look at installing Visual Studio. Visual Studio, or VS, is an IDE or Integrated Development Environment that is used to write programs, debug programs, and so much more! VS is created and released under Microsoft and they have multiple different versions. The one that we will be looking at today will be Visual Studio Community Edition. They also have VS for Mac, VS Code, and an Enterprise version of VS for those working in large organizations.

So what can you do with VS? Well, for starters, you can develop CLI (Command Line Interface) applications in a variety of languages like C#, F#, and even Python! You can develop windows applications, work with Azure, and even build websites, mobile apps, and more!


Step 1


To get started, navigate over to: https://visualstudio.microsoft.com/ to find the correct version for your system. If you are on a MAC, you must download the VS for MAC, but if you are on Windows you can download VS Community Edition or VS Code. Community edition is a full blown IDE where VS Code is more just a code editor that has some, but not all, features of standard VS.


Visual Studio Home Page
Once you have selected the proper version that you wish to download, a download prompt should appear asking you to save VS to your computer. Save it where you normally would save applications. Once it has downloaded, you can navigate to that folder on your computer, double click the installer, and begin the installation.


Save Visual Studio Installer
Visual Studio Installer Location

Step 2


Now at this point, you will be taken to a UAC screen that will ask permission continue with the install. Once you have accepted that, another screen appears asking to download some additional software needed for Visual Studio to run. Just accept and let it do its thing. Depending on what dependencies you already have installed this can go fast, or may take a minute to download and install.


Visual Studio Installer Screen 1
Visual Studio Installer Screen 2
Now that it is done downloading the dependencies needed for Visual Studio to run, the next screen is where you can select the workloads that you want to install. The base install is somewhere just under 700MB. Adding additional workflows will balloon the size quite a bit. For instance, just selecting the Python workload gets the install size well over 2GB. If space is a limiting factor for you, you may want to select the workload that you will want to use, and see what the install size will be, before actually installing, in the lower right hand corner. In the following pic, I just picked a random bunch of workloads to install, but since I already have Visual Studio Enterprise 2019, I didn’t actually install these.


Visual Studio Installer Screen 3
As you can see with this random workload selection, we are over 5GB in total install size. Again, just be wary of what you install if size matters for your specific PC. Once the installation begins, you will be taken to another screen that will show you the progress of the install.


Visual Studio Installer Screen 4
Visual Studio Startup Page



Once the installation is complete, you can head over to our next tutorial that will walk through the basics of VS Community Edition and the GUI. There is a lot to to it, but you don’t need to know every tool, every button, and every action possible just starting out. The main stuff will be creating a simple application, running it, and debugging it. We will cover those topics in an upcoming tutorial.

What are your prefered IDE’s if you already have some? What about code editors? Let me know down in the comments below!

Pin It on Pinterest