<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Tech Elevator</title>
    <description>The latest articles on DEV Community by Tech Elevator (@techelevator).</description>
    <link>https://dev.to/techelevator</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F2133%2F41c04f9e-96b9-4ee7-a272-1abb61fbf503.jpg</url>
      <title>DEV Community: Tech Elevator</title>
      <link>https://dev.to/techelevator</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/techelevator"/>
    <language>en</language>
    <item>
      <title>What Does ChatGPT Mean for New Software Developers?</title>
      <dc:creator>Matt Eland</dc:creator>
      <pubDate>Mon, 19 Dec 2022 21:54:04 +0000</pubDate>
      <link>https://dev.to/techelevator/what-does-chatgpt-mean-for-new-software-developers-3e8a</link>
      <guid>https://dev.to/techelevator/what-does-chatgpt-mean-for-new-software-developers-3e8a</guid>
      <description>&lt;p&gt;I spend my days teaching new developers how to code at &lt;a href="https://www.techelevator.com/" rel="noopener noreferrer"&gt;Tech Elevator’s fantastic programming bootcamp&lt;/a&gt;. My evenings and weekends, however, belong to my study of data science, artificial intelligence, and conversational AI.&lt;/p&gt;

&lt;p&gt;Recently I’ve watched these two worlds crash together with the sudden revelation of &lt;a href="https://chat.openai.com/" rel="noopener noreferrer"&gt;OpenAI’s ChatGPT&lt;/a&gt; chatbot and the incredible things it can (and can’t) do.&lt;/p&gt;

&lt;p&gt;In this post we’re going to explore what ChatGPT is and what it means for current and future software engineers.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is ChatGPT?
&lt;/h2&gt;

&lt;p&gt;ChatGPT is a new conversational AI chatbot developed by OpenAI that reached public visibility in late November of 2022. Unlike traditional chatbots, ChatGPT is able to take advantage of advances in machine learning using something called transformers, which give it a greater contextual awareness of the documents it has been trained on. This allows it to generate responses that mimic those you might see from a human.&lt;/p&gt;

&lt;p&gt;What makes ChatGPT different from anything that has come before is its breadth of responses and its ability to generate new responses that seem to have a high degree of intelligence behind them. This means that I can ask ChatGPT to tell me stories, outline an article, or even generate code and it will give me something that looks convincing and may even be usable.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz1ldds204q06ll4msebk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz1ldds204q06ll4msebk.png" alt="ChatGPT generating a for loop in Java and explaining it" width="724" height="395"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However, ChatGPT is not human-like intelligence, though it’s the closest I’ve ever seen a computer come to emulating it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What ChatGPT Can’t Do
&lt;/h2&gt;

&lt;p&gt;ChatGPT is open about its limitations and displays it on its landing page:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnm1dr30cfu4ra00mvqkb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnm1dr30cfu4ra00mvqkb.png" alt="ChatGPT Limits" width="794" height="475"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;ChatGPT’s intelligence is in its contextual awareness in conversation and the breadth of information it’s been trained on. But this is &lt;em&gt;historical&lt;/em&gt; information.&lt;/p&gt;

&lt;p&gt;I’ve certainly seen ChatGPT make mistakes. It’s given me factually incorrect information about software libraries, has even made up libraries that don’t exist and referred me to libraries that have long ago been retired.&lt;/p&gt;

&lt;p&gt;ChatGPT is not human and lacks the ability to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Understand that what it generates may be incorrect (or communicate its lack of confidence in its answers)&lt;/li&gt;
&lt;li&gt;  Understand the emotional / practical needs of humans&lt;/li&gt;
&lt;li&gt;  Understand the basic characteristics of our world&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As a humorous example, I gave a conference talk this year entitled: “Automating my Dog with Azure Cognitive Services.” It was a fun exploration of using artificial intelligence to recognize objects in images, generate speech responses from text, and interpret human text.&lt;/p&gt;

&lt;p&gt;When I asked ChatGPT how it would structure that talk, it gave me a beautiful outline that was perfect … except it suggested that artificial intelligence could listen to my dog’s spoken words and respond appropriately. For all of its intelligence and impressiveness, &lt;em&gt;it failed to grasp the basic fact that my dog cannot speak English&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;It’s incredible that ChatGPT can generate content for you, but that comes with some limitations as well. First of all, ChatGPT is not truly synthesizing new things. Instead, it is arranging things it has encountered before in creative ways.&lt;/p&gt;

&lt;p&gt;It may be arranging aspects of the English language, story structures, or answers it sees posted in locations it deems trustworthy, but it is arranging content and structure that it knows about already in new ways.&lt;/p&gt;

&lt;p&gt;This means that if we stop creating new articles, stories, programs, and works of art, ChatGPT and systems like it will not be inventing anything new on their own.&lt;/p&gt;

&lt;p&gt;Another severe limitation of transformer-based systems like ChatGPT is that they are very hard to understand how they came up with content. This means that if ChatGPT generates a response, that response may be a word-for-word quote from someone else and you wouldn’t even know.&lt;/p&gt;

&lt;p&gt;However, ChatGPT and systems like it can generate some very good starter code and give you answers that are often more helpful than they are not.&lt;/p&gt;

&lt;h2&gt;
  
  
  Will People Still Need Software Developers?
&lt;/h2&gt;

&lt;p&gt;Since transformer-based systems are only five years old at this point, it begs the question: in five more years, will we need developers at all?&lt;/p&gt;

&lt;p&gt;Let me tell you a little secret: since I’ve been a programmer, people have been talking about no-code and low-code approaches to software development that remove those pesky software developers from the equation.&lt;/p&gt;

&lt;p&gt;Thus far, none of these systems have delivered on their promise. This is because software development is an incredibly complex field that requires you to think about many different aspects of development including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Meeting the business needs&lt;/li&gt;
&lt;li&gt;  Quality / testability&lt;/li&gt;
&lt;li&gt;  Speed of delivery (deadlines, project plans, etc)&lt;/li&gt;
&lt;li&gt;  Ease of maintenance&lt;/li&gt;
&lt;li&gt;  Performance as the number of users or volume of data scales up&lt;/li&gt;
&lt;li&gt;  Security&lt;/li&gt;
&lt;li&gt;  Explainability&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It turns out that in order to meet the varying and competing requirements of a software project, you need to be able to understand people, balance those competing concerns and deliver a creative solution that meets those needs in both short and long term ways.&lt;/p&gt;

&lt;p&gt;Because ChatGPT doesn’t actually &lt;em&gt;understand&lt;/em&gt; the content it generates, it has no idea if its responses will work or are relevant to all of your business needs.&lt;/p&gt;

&lt;p&gt;Because the code ChatGPT generates is based on code it has encountered before, it cannot make any guarantees that the generated code:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Is free of bugs&lt;/li&gt;
&lt;li&gt;  Is well-documented&lt;/li&gt;
&lt;li&gt;  Is easy to understand and maintain&lt;/li&gt;
&lt;li&gt;  Is free of security vulnerabilities&lt;/li&gt;
&lt;li&gt;  Meets the entire requirements set out by the business&lt;/li&gt;
&lt;li&gt;  Is not an exact duplicate of code encountered on the internet&lt;/li&gt;
&lt;li&gt;  Performs adequately at scale in a production environment&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Perhaps most crucially, ChatGPT cannot modify code that it has previously authored or understand large solutions and modify them as needed.&lt;/p&gt;

&lt;p&gt;This technology is only five years old, and it will evolve and become more transparent, easier to control and even more useful in the future, but it will never:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  think for its own,&lt;/li&gt;
&lt;li&gt;  understand your business context,&lt;/li&gt;
&lt;li&gt;  or understand the humans involved with and invested in your system.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Even if a successor to ChatGPT overcomes many of these limitations, you still need someone with a deep technical understanding to be able to tell it what to do and evaluate the quality of its output.&lt;/p&gt;

&lt;h2&gt;
  
  
  How can ChatGPT help me on my Journey into Tech?**
&lt;/h2&gt;

&lt;p&gt;Instead of &lt;em&gt;replacing&lt;/em&gt; developers, I see ChatGPT, GitHub CoPilot, Amazon CodeWhisperer, and systems like these (as well as those that follow) as &lt;strong&gt;new tools in the developer’s tool belt.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;These code generation tools are good at generating basic “boilerplate” code that can then be refined and modified by a professional developer to meet your needs.&lt;/p&gt;

&lt;p&gt;However, as a new learner, I’d encourage you &lt;em&gt;not&lt;/em&gt; to use ChatGPT excessively to generate code. This is because you are still building the mental muscles needed to generate for loops, methods, and variable declarations. You are still learning to think critically about things to build your own understanding.&lt;/p&gt;

&lt;p&gt;At &lt;a href="https://techelevator.com/" rel="noopener noreferrer"&gt;Tech Elevator&lt;/a&gt;, we move quickly and I have seen a few students resist the requirements of daily homework practice thinking that it was beneath them or not worth their time—only to discover that by skipping this work they had not developed the skills and understanding necessary for the more complex aspects of software development. I see ChatGPT offering this same temptation to new learners.&lt;/p&gt;

&lt;p&gt;I’m not saying that ChatGPT is dangerous or to be completely avoided. I’m saying that I would use it as a refresher on concepts you’ve already learned and only use it to generate code as a last resort. In fact, I’d recommend seeking help initially from a human instead of ChatGPT, especially when it comes to code that doesn’t work.&lt;/p&gt;

&lt;p&gt;Using ChatGPT before you’ve internalized the mechanics of programming is like asking a preschooler to learn to ride a bike by giving them a motorcycle instead of a tricycle or bike with training wheels.&lt;/p&gt;

&lt;p&gt;ChatGPT can be incredible, but you are going to be far better off finding a qualified developer to mentor you early on in your journey instead of relying on its code. Not only can a human understand you and tailor their answers to your experience, needs, and emotional state, but frankly you won’t even &lt;em&gt;know&lt;/em&gt; the right questions to ask an AI system until you have enough experience.&lt;/p&gt;

&lt;h2&gt;
  
  
  ChatGPT as a Tool for Software Engineering**
&lt;/h2&gt;

&lt;p&gt;As a seasoned developer I know many things about programming and have the syntax and methods I use on a regular basis committed to memory. However, there are infrequent tasks that I often need to search for a quick refresher periodically.&lt;/p&gt;

&lt;p&gt;In this regard, ChatGPT meets my needs quite nicely as an alternative to Google. ChatGPT generates simple code for me to use as reference (not to copy / paste) and refresh myself on its syntax.&lt;/p&gt;

&lt;p&gt;Additionally, ChatGPT is invaluable when using a new library or language. I might know how to do a for loop in one programming language, but forget the syntax in another language. ChatGPT helps me transfer my existing knowledge more easily between languages.&lt;/p&gt;

&lt;p&gt;Ultimately, ChatGPT and the systems that follow it signal the advent of new code generation tools we’ve not seen before. These tools are incredibly powerful and appealing, but they require the guidance of a trained professional. Learning to program will help you know when, where, and how to use this tool to build the best software you can.&lt;/p&gt;

&lt;p&gt;Personally, I’m incredibly excited to see where the future takes us and see if we can improve and harness these incredible tools to build even better things as software engineers.&lt;/p&gt;




&lt;p&gt;This post was originally published at &lt;a href="https://www.techelevator.com/what-chatgpt-means-for-new-developers/" rel="noopener noreferrer"&gt;Tech Elevator&lt;/a&gt; on December 19th, 2022.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>chatgpt</category>
      <category>career</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Do I need to be Good at Math to be a Software Developer?</title>
      <dc:creator>Matt Eland</dc:creator>
      <pubDate>Mon, 14 Nov 2022 17:00:38 +0000</pubDate>
      <link>https://dev.to/techelevator/do-i-need-to-be-good-at-math-to-be-a-software-developer-eo4</link>
      <guid>https://dev.to/techelevator/do-i-need-to-be-good-at-math-to-be-a-software-developer-eo4</guid>
      <description>&lt;p&gt;&lt;em&gt;Editorial note: This article was originally published to &lt;a href="https://www.techelevator.com/do-i-need-good-math-to-be-software-developer/" rel="noopener noreferrer"&gt;Tech Elevator’s blog&lt;/a&gt; on October 31st, 2022&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;As a software engineering instructor at &lt;a href="https://TechElevator.com" rel="noopener noreferrer"&gt;Tech Elevator&lt;/a&gt;, one question I hear most often from new and prospective students is this:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Do I need to be good at math in order to be a software developer?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Thankfully the answer is a resounding &lt;strong&gt;No&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;What I've found in my time teaching is that every student has different strengths and weaknesses and a unique way of thinking. Some students are naturally inclined towards math, while others dread it (as I suspect you might be if you're reading this article). And yet, they make fantastic software developers.&lt;/p&gt;

&lt;p&gt;Personally, I have found aspects of math that I love and aspects of math that make me panic and shut down. Regardless of my weaknesses, I enjoyed a very successful career as a software engineer.&lt;/p&gt;

&lt;p&gt;Let's talk about what you actually need to know and the skills you do need to be a successful programmer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why You Don't Need to be Good at Math to be a Programmer
&lt;/h2&gt;

&lt;p&gt;Many people assume that because many lines of code resemble algebra at a glance that you need to be good at math in order to program.&lt;/p&gt;

&lt;p&gt;This is very much not the case. Mathematics is all about following formulas and theorems to calculate values by simplifying and reducing values.&lt;/p&gt;

&lt;p&gt;Programming, on the other hand, is about setting up a series of simple instructions for a computer to follow and carry out to achieve the task you're trying to accomplish.&lt;/p&gt;

&lt;p&gt;For example, a program might follow this series of instructions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Display a greeting message to the user.&lt;/li&gt;
&lt;li&gt;Prompt the user to type in their age in years.&lt;/li&gt;
&lt;li&gt;Wait for the user to type in their age in years, then store the result.&lt;/li&gt;
&lt;li&gt;Multiply the number the user entered by 365 and store the result.&lt;/li&gt;
&lt;li&gt;Display a message to the user informing them that they're at least that many days old.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;While there is math here (multiplying a number by the number of days in a year), as a programmer you don't even need to be able to do that multiplication yourself; you just need to tell the computer what task to complete.&lt;/p&gt;

&lt;p&gt;Much of software development follows this flow: figure out a path for the program to take to accomplish a specific task. This path may involve mathematical operations such as calculating totals, but it doesn't have to.&lt;/p&gt;

&lt;h2&gt;
  
  
  Logical Thinking in Software Development
&lt;/h2&gt;

&lt;p&gt;Instead of asking yourself if you're good at math, ask yourself the following questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Am I able to break down large tasks into a series of small steps?&lt;/li&gt;
&lt;li&gt;Do I like improving things?&lt;/li&gt;
&lt;li&gt;Do I enjoy using creative thinking to solve problems?&lt;/li&gt;
&lt;li&gt;Do I enjoy making little changes that add up over time to build larger things?&lt;/li&gt;
&lt;li&gt;Can I consider many different possibilities?&lt;/li&gt;
&lt;li&gt;Do I like to learn new things?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Programming is all about telling computers to calculate and store values, making decisions based on what something currently is and interacting with the user, files, databases and other systems.&lt;br&gt;
Let's take a look at a small piece of code that gets a temperature from the user and displays a message:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Display a message to the user&lt;/span&gt;
&lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Please enter a temperature in degrees Fahrenheit"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Store a value from the user&lt;/span&gt;
&lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;userInput&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ReadLine&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="c1"&gt;// Convert from text to a number&lt;/span&gt;
&lt;span class="kt"&gt;double&lt;/span&gt; &lt;span class="n"&gt;temperature&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Convert&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ToDouble&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;userInput&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Display a message to the user indicating the temperature range&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;temperature&lt;/span&gt; &lt;span class="p"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="m"&gt;85&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="c1"&gt;// 85 degrees or more&lt;/span&gt;
   &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"It's pretty hot today!"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;temperature&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="m"&gt;50&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="c1"&gt;// 50 degrees or less &lt;/span&gt;
   &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"It's cold today!"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="c1"&gt;// 51 to 84 degrees&lt;/span&gt;
   &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"It's a nice day!"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is similar to the material we cover at the &lt;a href="https://www.techelevator.com/an-inside-look-week-one-in-tech-elevators-coding-bootcamp/" rel="noopener noreferrer"&gt;beginning of our curriculum&lt;/a&gt; at Tech Elevator, so it's perfectly fine if you can't read this code yet. I included this to illustrate what typical code looks like and how different it is from math.&lt;/p&gt;

&lt;p&gt;This C# code lets the user type in a number and converts that number from text (a string) to a numeric value (a double). Next, we use conditional logic to display a message to the user based on the temperature. The user will then see a message indicating if it's hot, cold, or nice weather.&lt;/p&gt;

&lt;p&gt;As you can see, there's very little mathematical notation here. Instead, we see programming syntax and commands to check if numbers are greater than or less than a value and display those values to the user.&lt;/p&gt;

&lt;p&gt;This is what 99% of programming is about: controlling program flow through logic and guiding the program to accomplish a specific task through a series of instructions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Math That Is Helpful for Software Development
&lt;/h2&gt;

&lt;p&gt;So, what aspects of mathematics are helpful for software developers?&lt;/p&gt;

&lt;p&gt;While we don't do traditional mathematics in software development, it is often helpful to understand mathematical principles.&lt;br&gt;
For example, if you don't understand the concepts of addition, subtraction, division (including remainders), multiplication and division, it's going to be difficult to write code that takes advantage of those concepts.&lt;/p&gt;

&lt;p&gt;As developers, we occasionally need to work with absolute values (removing a negative sign if one is present), averaging, getting the largest or smallest value and a handful of other mathematical operations.&lt;/p&gt;

&lt;p&gt;If you are interested in specialized types of development, there may be other aspects of mathematics that will help you. For example, in game development I frequently found myself challenged by being weak in trigonometry. However, recent years have actually made it easier to do game development tasks without requiring a heavy understanding of trigonometry.&lt;/p&gt;

&lt;p&gt;Finally, as programmers, we do sometimes talk about something called "Big O notation," which is a mathematical notation illustrating how much slower a program gets the more you add items to a list of data. This topic is beyond the scope of this article, but at its core Big O is centered on understanding how sharply the amount of time will increase the more you add data.&lt;/p&gt;

&lt;p&gt;Mathematical knowledge will help you with software development and may show you possibilities that you wouldn't have considered without it. However, the majority of programming is logical thinking, not pure mathematics.&lt;/p&gt;

&lt;p&gt;Ultimately, only you know what you are capable of and how you best solve problems. If you've never tried programming before, you should try following a few &lt;a href="https://www.techelevator.com/livestream-building-your-first-webpage/" rel="noopener noreferrer"&gt;tutorials&lt;/a&gt; to see how you like it.&lt;/p&gt;

&lt;p&gt;One of my greatest joys as an instructor is seeing students who didn't think they could be developers get jobs, thrive and succeed in those jobs. At Tech Elevator we are very skilled and passionate about helping students discover what they can and can't do. &lt;strong&gt;Don't let fear of mathematics stand in your way from becoming part of something amazing&lt;/strong&gt; and enjoying a profoundly rewarding career in tech.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ready to Kickstart Your Career Transformation?
&lt;/h2&gt;

&lt;p&gt;If you're ready to take the next step and think a career as a software developer is the path for you, then take our &lt;a href="https://www.techelevator.com/coding-aptitude-test/" rel="noopener noreferrer"&gt;Aptitude Test&lt;/a&gt; to get started.&lt;/p&gt;

&lt;p&gt;If you still have unanswered questions, schedule some time to &lt;a href="https://www.techelevator.com/coding-bootcamp/admissions/" rel="noopener noreferrer"&gt;talk with our admissions team&lt;/a&gt;. We're happy to help explore your future career options in tech.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>math</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>How to Build a Game &amp; Learn C# - Loops &amp; Finishing the Game</title>
      <dc:creator>Matt Eland</dc:creator>
      <pubDate>Tue, 23 Feb 2021 14:39:10 +0000</pubDate>
      <link>https://dev.to/techelevator/how-to-build-a-game-learn-c-loops-finishing-the-game-3885</link>
      <guid>https://dev.to/techelevator/how-to-build-a-game-learn-c-loops-finishing-the-game-3885</guid>
      <description>&lt;p&gt;In this final part of a four-part tutorial series we'll complete our "Guess the Number" game that we've been developing.&lt;/p&gt;

&lt;p&gt;This final tutorial brings everything together and also introduces the key concept of loops and shows you a way to generate random numbers in .NET.&lt;/p&gt;

&lt;p&gt;By the time we're done, you'll have a working game where the program secretly selects a number between 1 and 100 and asks the player to pick numbers until they've guessed it.&lt;/p&gt;

&lt;p&gt;This article is also available in video form: &lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/r8lsO1bbiDQ"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: This series is based loosely on some of the content from the 1st week of &lt;a href="https://www.TechElevator.com?utm_campaign=Homepage_Traffic&amp;amp;utm_medium=Homepage%20Referral&amp;amp;utm_source=GuessTheNumberCSharp" rel="noopener noreferrer"&gt;Tech Elevator&lt;/a&gt;'s 14 week C# curriculum&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Our Code as we last saw it
&lt;/h1&gt;

&lt;p&gt;This was our code by the end of the last tutorial:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;System&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;GuessTheNumber&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Program&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Main&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="c1"&gt;// The program's secret number that the player has to guess&lt;/span&gt;
            &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;secretNumber&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;42&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// TODO: This should be random between 1 - 100&lt;/span&gt;
            &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;guess&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

            &lt;span class="c1"&gt;// Let the player enter a number&lt;/span&gt;
            &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"What is your guess?"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;guessText&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ReadLine&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

            &lt;span class="c1"&gt;// Evaluate the player's guess and respond&lt;/span&gt;
            &lt;span class="n"&gt;guess&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;guessText&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;guess&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; &lt;span class="n"&gt;secretNumber&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"You guessed the secret number!"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

                &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"The application will now close."&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;guess&lt;/span&gt; &lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;secretNumber&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"The number is lower than "&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="n"&gt;guess&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt; 
            &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="c1"&gt;// If we got here guess must be &amp;lt; secretNumber&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"The number is greater than "&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="n"&gt;guess&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;

            &lt;span class="c1"&gt;// TODO: Loop until the player gets the answer right&lt;/span&gt;

            &lt;span class="c1"&gt;// After this line is reached, the program will end&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At present, the application lets us guess a number and then tells us if that number is correct, too high, or too low. You currently only get a single guess, and the number you're trying to guess is always the same.&lt;/p&gt;

&lt;p&gt;Let's fix that, starting with the problem of the player only getting one guess.&lt;/p&gt;

&lt;h1&gt;
  
  
  While Loops
&lt;/h1&gt;

&lt;p&gt;If we want the user to keep guessing numbers until they guess the correct one, we'll need something called a loop.&lt;/p&gt;

&lt;p&gt;When writing code, often we'll want to either do something a specific number of times or even do something continuously until a specific condition is met. In C# we have a surprising number of ways of writing loops, but one of the simplest types of loops will work fine for our application here: the &lt;em&gt;while loop&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;A while loop will do something while a condition is true. So, for example, while the user hasn't guessed the number, ask the user what number they want to pick and then tell them if their guess was right, high, or low.&lt;/p&gt;

&lt;p&gt;In fact, that's exactly what we want to do. Let's do this by going to where we declared our &lt;code&gt;guess&lt;/code&gt; variable (not &lt;code&gt;guessText&lt;/code&gt;) and adding a pair of lines after that:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;guess&lt;/span&gt; &lt;span class="p"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;secretNumber&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If this looks a little like an &lt;code&gt;if&lt;/code&gt; statement from the last tutorial, that's because they're very closely related. While an if statement would look like &lt;code&gt;if (guess != secretNumber)&lt;/code&gt; instead we use the &lt;code&gt;while&lt;/code&gt; keyword.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;while&lt;/code&gt; loop will execute the code between it's &lt;code&gt;{ }&lt;/code&gt;'s as long as the condition in the parentheses is true at the beginning of the loop.&lt;/p&gt;

&lt;p&gt;A quick note on &lt;code&gt;!=&lt;/code&gt; - this is very closely related to &lt;code&gt;==&lt;/code&gt; meaning two things are equals, but instead &lt;code&gt;!=&lt;/code&gt; indicates &lt;em&gt;not&lt;/em&gt; equal. So here we're essentially saying "while the guess is not equal to the correct answer".&lt;/p&gt;

&lt;p&gt;You may have noticed that we haven't closed our loop yet. We'll need to add a matching &lt;code&gt;}&lt;/code&gt; to the program for the compiler to be happy, so let's do that now.&lt;/p&gt;

&lt;p&gt;Add a &lt;code&gt;}&lt;/code&gt; to the line just before the final comment in the application. &lt;/p&gt;

&lt;p&gt;Your &lt;code&gt;Main&lt;/code&gt; method should now look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;        &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Main&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="c1"&gt;// The program's secret number that the player has to guess&lt;/span&gt;
            &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;secretNumber&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;42&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// TODO: This should be random between 1 - 100&lt;/span&gt;
            &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;guess&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

            &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;guess&lt;/span&gt; &lt;span class="p"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;secretNumber&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="c1"&gt;// Let the player enter a number&lt;/span&gt;
                &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"What is your guess?"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
                &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;guessText&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ReadLine&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

                &lt;span class="c1"&gt;// Evaluate the player's guess and respond&lt;/span&gt;
                &lt;span class="n"&gt;guess&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;guessText&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
                &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;guess&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; &lt;span class="n"&gt;secretNumber&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                &lt;span class="p"&gt;{&lt;/span&gt;
                    &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"You guessed the secret number!"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

                    &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"The application will now close."&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
                &lt;span class="p"&gt;}&lt;/span&gt;
                &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;guess&lt;/span&gt; &lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;secretNumber&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                &lt;span class="p"&gt;{&lt;/span&gt;
                    &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"The number is lower than "&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="n"&gt;guess&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
                &lt;span class="p"&gt;}&lt;/span&gt;
                &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="c1"&gt;// If we got here guess must be &amp;lt; secretNumber&lt;/span&gt;
                &lt;span class="p"&gt;{&lt;/span&gt;
                    &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"The number is greater than "&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="n"&gt;guess&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
                &lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;

            &lt;span class="c1"&gt;// After this line is reached, the program will end&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And when we run it, you should be able to guess numbers until you arrive at the secret number (which is still always 42)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fsbgpo914zjuy03kisxh5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fsbgpo914zjuy03kisxh5.png" alt="Guessing Numbers" width="800" height="418"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Randomization
&lt;/h1&gt;

&lt;p&gt;Now that we've got everything working properly in the loop, we have one final step: our program needs to secretly pick a random number when it runs for the first time.&lt;/p&gt;

&lt;p&gt;To do this, we'll introduce a new part of .NET development: the &lt;code&gt;Random&lt;/code&gt; class.&lt;/p&gt;

&lt;p&gt;Lets replace the &lt;code&gt;int secretNumber = 42;&lt;/code&gt; line at the top of our program with the following two lines:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="n"&gt;Random&lt;/span&gt; &lt;span class="n"&gt;randomizer&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;Random&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;secretNumber&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;randomizer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Next&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;100&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These final two lines complete our program, but what do they do?&lt;/p&gt;

&lt;p&gt;The first declares a new variable named &lt;code&gt;randomizer&lt;/code&gt; that will store a &lt;code&gt;Random&lt;/code&gt; class instance, which is then created and assigned into the &lt;code&gt;randomizer&lt;/code&gt; variable. &lt;/p&gt;

&lt;p&gt;This syntax and classes in general are beyond the scope of this tutorial series (and are something that we devote entire weeks of our curriculum to at &lt;a href="https://www.TechElevator.com?utm_campaign=Homepage_Traffic&amp;amp;utm_medium=Homepage%20Referral&amp;amp;utm_source=GuessTheNumberCSharp" rel="noopener noreferrer"&gt;Tech Elevator&lt;/a&gt;), but for now understand that a class is a collection of related functionality and data around some sort of programming concept.&lt;/p&gt;

&lt;p&gt;In our case, the &lt;code&gt;Random&lt;/code&gt; class contains a lot of related methods around random number generation, and that's exactly what we use it for on the second line. &lt;code&gt;int secretNumber = randomizer.Next(1, 100);&lt;/code&gt; generates a random integer between 1 and 100 and stores it into our &lt;code&gt;secretNumber&lt;/code&gt; variable.&lt;/p&gt;

&lt;p&gt;With that, our program is now able to generate a random number.&lt;/p&gt;

&lt;h1&gt;
  
  
  Putting it All Together
&lt;/h1&gt;

&lt;p&gt;Let's take a step back and look at our program as a whole:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;System&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;GuessTheNumber&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Program&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Main&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="c1"&gt;// The program's secret number that the player has to guess&lt;/span&gt;
            &lt;span class="n"&gt;Random&lt;/span&gt; &lt;span class="n"&gt;randomizer&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;Random&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
            &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;secretNumber&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;randomizer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Next&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;100&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;guess&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

            &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;guess&lt;/span&gt; &lt;span class="p"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;secretNumber&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="c1"&gt;// Let the player enter a number&lt;/span&gt;
                &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"What is your guess?"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
                &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;guessText&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ReadLine&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

                &lt;span class="c1"&gt;// Evaluate the player's guess and respond&lt;/span&gt;
                &lt;span class="n"&gt;guess&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;guessText&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
                &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;guess&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; &lt;span class="n"&gt;secretNumber&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                &lt;span class="p"&gt;{&lt;/span&gt;
                    &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"You guessed the secret number!"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

                    &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"The application will now close."&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
                &lt;span class="p"&gt;}&lt;/span&gt;
                &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;guess&lt;/span&gt; &lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;secretNumber&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                &lt;span class="p"&gt;{&lt;/span&gt;
                    &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"The number is lower than "&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="n"&gt;guess&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
                &lt;span class="p"&gt;}&lt;/span&gt;
                &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="c1"&gt;// If we got here guess must be &amp;lt; secretNumber&lt;/span&gt;
                &lt;span class="p"&gt;{&lt;/span&gt;
                    &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"The number is greater than "&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="n"&gt;guess&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
                &lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;

            &lt;span class="c1"&gt;// After this line is reached, the program will end&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here our program picks a random number. We then loop until the user's guess is equal to that number. Each time we loop the player is prompted to guess a number. The text they type in is then parsed into an integer which can be compared to the secret number. The program then compares the guess to the secret number and displays an appropriate response.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F0xmpzlhtmyugxw7zk59o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F0xmpzlhtmyugxw7zk59o.png" alt="The Final Result" width="800" height="418"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  What's Next?
&lt;/h1&gt;

&lt;p&gt;Congratulations! If you followed along, you wrote a fairly simple console game in C#.&lt;/p&gt;

&lt;p&gt;This app, while short, illustrates some key programming concepts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Variables&lt;/li&gt;
&lt;li&gt;Expressions&lt;/li&gt;
&lt;li&gt;Basic Data Types&lt;/li&gt;
&lt;li&gt;If / Else Statements&lt;/li&gt;
&lt;li&gt;Loops&lt;/li&gt;
&lt;li&gt;Console Input and Output&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is by no means everything that C# has to offer. In fact, this series based off of a small portion of the &lt;em&gt;first week&lt;/em&gt; of &lt;a href="https://www.TechElevator.com?utm_campaign=Homepage_Traffic&amp;amp;utm_medium=Homepage%20Referral&amp;amp;utm_source=GuessTheNumberCSharp" rel="noopener noreferrer"&gt;Tech Elevator's 14 week curriculum&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;While this was just a small taste of C# and .NET development, it should give you a feeling for what it is like to work with code and structure programs.&lt;/p&gt;

&lt;p&gt;If you'd like to learn more, there are plenty of books, articles, and courses on software development. Of course, I have to plug Tech Elevator's 14 week C# and Java curriculum. Both are centered around learning full stack development with JavaScript and Vue.js on the front-end. Both emphasize learning by building things with regular individual exercises, pair assignments, and larger projects. Tech Elevator also supports students through this journey by giving them ready access to veteran industry professionals (such as myself) who are heavily invested in their success. &lt;/p&gt;

&lt;p&gt;If you'd like to learn more about Tech Elevator, I strongly encourage you to take a free &lt;a href="https://www.techelevator.com/aptitude-test?utm_campaign=Get%20Started_Traffic&amp;amp;utm_medium=Get%20Started%20Page&amp;amp;utm_source=GuessTheNumberCSharp" rel="noopener noreferrer"&gt;mini-aptitude test&lt;/a&gt; or check out a number of our other &lt;a href="https://www.techelevator.com/learn-to-code-resources?utm_campaign=Homepage_Traffic&amp;amp;utm_medium=Homepage%20Referral&amp;amp;utm_source=GuessTheNumberCSharp" rel="noopener noreferrer"&gt;Learn to Code resources&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;On a more personal note, however you wind up learning, I wish you the best success. I can't imagine my life without programming and the ability to be able to imagine something and then make it a real thing by writing on a computer is something that still amazes me after 3 decades of writing code.&lt;/p&gt;

</description>
      <category>csharp</category>
      <category>tutorial</category>
      <category>beginners</category>
      <category>dotnet</category>
    </item>
    <item>
      <title>How to Build a Game &amp; Learn C#: User Input &amp; If Statements</title>
      <dc:creator>Matt Eland</dc:creator>
      <pubDate>Tue, 23 Feb 2021 14:35:30 +0000</pubDate>
      <link>https://dev.to/techelevator/how-to-build-a-game-learn-c-user-input-if-statements-1o78</link>
      <guid>https://dev.to/techelevator/how-to-build-a-game-learn-c-user-input-if-statements-1o78</guid>
      <description>&lt;p&gt;In our last two tutorials we discussed creating a new C# project and the concepts of variables and expressions as we moved towards programming our first application: a Guess the Number Game. &lt;/p&gt;

&lt;p&gt;In this tutorial, we'll expand our bag of tools to get text from the user, interpret it as a number and perform some basic mathematics with it. We'll close by introducing &lt;em&gt;if statements&lt;/em&gt;, an extremely powerful tool in our toolbelts as programmers.&lt;/p&gt;

&lt;p&gt;This article is also available in video form:&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/Xz3VASJXyeQ"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: This series is based loosely on some of the content from the 1st week of &lt;a href="https://www.TechElevator.com?utm_campaign=Homepage_Traffic&amp;amp;utm_medium=Homepage%20Referral&amp;amp;utm_source=GuessTheNumberCSharp" rel="noopener noreferrer"&gt;Tech Elevator&lt;/a&gt;'s 14 week C# curriculum&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Let's get started.&lt;/p&gt;

&lt;h1&gt;
  
  
  Cleaning the Slate
&lt;/h1&gt;

&lt;p&gt;In our last article we wrote some basic code to illustrate &lt;code&gt;string&lt;/code&gt; and &lt;code&gt;int&lt;/code&gt; variables. That was good as a learning exercise, but it won't be useful for our final application, a game where the user can guess a number from one to one hundred and be told if their guess was high, low, or correct.&lt;/p&gt;

&lt;p&gt;Let's clear out the existing &lt;code&gt;Main&lt;/code&gt; method and replace it with this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Main&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// The program's secret number that the player has to guess&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;secretNumber&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;42&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// TODO: This should be random between 1 - 100&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;guess&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="c1"&gt;// TODO: Let the player enter a number&lt;/span&gt;

    &lt;span class="c1"&gt;// TODO: Evaluate the player's guess and respond&lt;/span&gt;

    &lt;span class="c1"&gt;// TODO: Loop until the player gets the answer right&lt;/span&gt;

    &lt;span class="c1"&gt;// After this line is reached, the program will end&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here we have a mostly empty method that has major comments for the logic we'll need to do in this tutorial and the next one in order to get the game working properly.&lt;/p&gt;

&lt;p&gt;We also have a &lt;code&gt;secretNumber&lt;/code&gt; integer variable that is set to &lt;code&gt;42&lt;/code&gt; for now, but we'll have the program generate a random number next tutorial. &lt;/p&gt;

&lt;p&gt;This &lt;code&gt;secretNumber&lt;/code&gt; represents the number that the player has to guess. By the end of this tutorial, you'll be able to enter a number into the console and be told if it is less than, greater than, or exactly the "secret" number.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: We're declaring our &lt;code&gt;guess&lt;/code&gt; variable here to save us some time and confusion later on. Don't worry about why this line is here yet.&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Getting User Input
&lt;/h1&gt;

&lt;p&gt;Let's expand the &lt;code&gt;// Let the player enter a number&lt;/code&gt; comment to include the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Let the player enter a number&lt;/span&gt;
&lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"What is your guess?"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;guessText&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ReadLine&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"You guessed: "&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="n"&gt;guessText&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Before we talk about the code, let's run the program with these changes. You should now be able to enter some text and see the result in the console as shown below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fcfbm7wswnhrq0rtvrsnh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fcfbm7wswnhrq0rtvrsnh.png" alt="Enter Your Guess" width="800" height="418"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This works because &lt;code&gt;Console.ReadLine()&lt;/code&gt; causes the program to wait for the user to type in some text and type enter. The program then takes that value and assigns it into the &lt;code&gt;guessText&lt;/code&gt; variable.&lt;/p&gt;

&lt;p&gt;So, if the user typed in "I'm Batman" (remember, &lt;code&gt;ReadLine&lt;/code&gt; allows the user to type in &lt;em&gt;any&lt;/em&gt; text), &lt;code&gt;guessText&lt;/code&gt; would store that string and the following line: &lt;code&gt;Console.WriteLine("You guessed: " + guessText);&lt;/code&gt; would evaluate to &lt;code&gt;Console.WriteLine("You guessed: I'm Batman");&lt;/code&gt; and display that message.&lt;/p&gt;

&lt;p&gt;Next, let's look at how we can interpret the user's input as a number.&lt;/p&gt;

&lt;h1&gt;
  
  
  Parsing Strings to Integers
&lt;/h1&gt;

&lt;p&gt;While we can't change &lt;code&gt;Console.ReadLine&lt;/code&gt; to have it return an &lt;code&gt;int&lt;/code&gt; instead of a &lt;code&gt;string&lt;/code&gt; or require a numeric input, we &lt;em&gt;can&lt;/em&gt; try to interpret the string the user typed in as a number.&lt;/p&gt;

&lt;p&gt;We do this via the &lt;code&gt;int.Parse&lt;/code&gt; method.&lt;/p&gt;

&lt;p&gt;Add the following code below the code you wrote earlier:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="n"&gt;guess&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;guessText&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"2 x "&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="n"&gt;guess&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="s"&gt;" = "&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;guess&lt;/span&gt; &lt;span class="p"&gt;*&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There's a decent amount going on here, so let's take it a line at a time.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;guess = int.Parse(guessText);&lt;/code&gt; sets the &lt;code&gt;guess&lt;/code&gt; variable we declared earlier to be the result of &lt;code&gt;int.Parse&lt;/code&gt; on the user's text. &lt;code&gt;int.Parse&lt;/code&gt; is a method provided by .NET's base class libraries that takes in a &lt;code&gt;string&lt;/code&gt; and attempts to convert it to an integer.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: There are ways of handling cases where the user types in random text instead of something that is a number. However, for the purposes of keeping this tutorial focused, we'll assume that the user is providing valid input&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Revisiting Expressions
&lt;/h1&gt;

&lt;p&gt;Next let's talk about that &lt;code&gt;Console.WriteLine("2 x " + guess + " = " + (guess * 2));&lt;/code&gt; line.&lt;/p&gt;

&lt;p&gt;This is similar to what we've seen before, but a bit more complicated. We have a few new things that we've not seen before in the &lt;code&gt;(guess * 2)&lt;/code&gt; expression.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;*&lt;/code&gt; operator means multiplication, so this will multiply the current value of &lt;code&gt;guess&lt;/code&gt; by &lt;code&gt;2&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;When this line runs and &lt;code&gt;guess&lt;/code&gt; is 5, it will first evaluate to&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"2 x "&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="m"&gt;5&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="s"&gt;" = "&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;5&lt;/span&gt; &lt;span class="p"&gt;*&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This simplifies down to&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"2 x "&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="m"&gt;5&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="s"&gt;" = "&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="m"&gt;10&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is a lot more familiar and simplifies to&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"2 x 5 = 10"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Which is exactly what is displayed on the screen.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fql4v7kdo7mc1lwrbc6e3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fql4v7kdo7mc1lwrbc6e3.png" alt="App displaying 2 x 5 = 10" width="800" height="418"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Getting Ready for Conditions
&lt;/h1&gt;

&lt;p&gt;Okay, now that we've demonstrated that integer parsing works, let's remove the last two &lt;code&gt;Console.WriteLine&lt;/code&gt; statements. Your code should now look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Main&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// The program's secret number that the player has to guess&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;secretNumber&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;42&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// TODO: This should be random between 1 - 100&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;guess&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="c1"&gt;// Let the player enter a number&lt;/span&gt;
    &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"What is your guess?"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;guessText&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ReadLine&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

    &lt;span class="c1"&gt;// TODO: Evaluate the player's guess and respond&lt;/span&gt;
    &lt;span class="n"&gt;guess&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;guessText&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// TODO: Loop until the player gets the answer right&lt;/span&gt;

    &lt;span class="c1"&gt;// After this line is reached, the program will end&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We should now be in a good place to start looking at interpreting the user's guess.&lt;/p&gt;

&lt;h1&gt;
  
  
  If Statements
&lt;/h1&gt;

&lt;p&gt;Now, let's look at some new syntax for conditionally doing things in code: the &lt;em&gt;if statement&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;If statements let us do specific logic if an expression evaluates to &lt;code&gt;true&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Below the &lt;code&gt;int guess = ...&lt;/code&gt; line, add the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;guess&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; &lt;span class="n"&gt;secretNumber&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"You guessed the secret number!"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"The application will now close."&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now when we run the application, if you type in "42" you should see the console message indicating you guessed the number:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Flbsxcud7nyeo1x4agd4d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Flbsxcud7nyeo1x4agd4d.png" alt="Correct Guess" width="800" height="418"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So let's look at how this works. We'll start at that first line: &lt;code&gt;if (guess == secretNumber)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;if&lt;/em&gt; statement requires parentheses. Inside these parentheses, C# needs an expression that evaluates to either &lt;code&gt;true&lt;/code&gt; or &lt;code&gt;false&lt;/code&gt;. If the expression evaluates to &lt;code&gt;true&lt;/code&gt;, any code inside of the &lt;code&gt;{ }&lt;/code&gt;'s will be executed. &lt;/p&gt;

&lt;p&gt;The code inside the &lt;code&gt;{}&lt;/code&gt;'s can be any C# code you can write - variable declarations, Console calls, etc. The key here is that it &lt;em&gt;only&lt;/em&gt; is executed if the expression in the if statement is &lt;code&gt;true&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Let's look a bit more at that expression: &lt;code&gt;guess == secretNumber&lt;/code&gt;. We've not seen &lt;code&gt;==&lt;/code&gt; before. The "double equals" operator is a way to compare the left side to the right side. If the two sides are equal, the expression will evaluate to &lt;code&gt;true&lt;/code&gt;, otherwise the expression will evaluate to &lt;code&gt;false&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;As an example, if the current value of &lt;code&gt;guess&lt;/code&gt; is 35, the line becomes &lt;code&gt;if (35 == 42)&lt;/code&gt; which evaluates to &lt;code&gt;if (false)&lt;/code&gt;. Since this value is &lt;code&gt;false&lt;/code&gt;, the code inside the &lt;code&gt;{ }&lt;/code&gt;'s will &lt;em&gt;not&lt;/em&gt; execute.&lt;/p&gt;

&lt;p&gt;Conversely, if &lt;code&gt;guess&lt;/code&gt; was 42, the line becomes &lt;code&gt;if (42 == 42)&lt;/code&gt; or &lt;code&gt;if (true)&lt;/code&gt; and the code inside the &lt;code&gt;{}&lt;/code&gt;'s &lt;em&gt;will&lt;/em&gt; work.&lt;/p&gt;

&lt;h1&gt;
  
  
  If / Else Blocks
&lt;/h1&gt;

&lt;p&gt;So, if statements are powerful, but they can do a bit more than we just did. We can add an &lt;code&gt;else&lt;/code&gt; statement after our &lt;code&gt;if&lt;/code&gt; as shown below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;guess&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; &lt;span class="n"&gt;secretNumber&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"You guessed the secret number!"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"The application will now close."&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;else&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Nope. That wasn't the number."&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here one of these two &lt;code&gt;{ }&lt;/code&gt; &lt;em&gt;blocks&lt;/em&gt; will always be executed. If the expression in the &lt;code&gt;if&lt;/code&gt; statement is &lt;code&gt;true&lt;/code&gt;, the first block will execute as before. Otherwise, the &lt;code&gt;else&lt;/code&gt; block will execute and the user will see the message indicating that they guessed incorrectly.&lt;/p&gt;

&lt;h1&gt;
  
  
  Chaining If / Else Blocks
&lt;/h1&gt;

&lt;p&gt;But wait, there's more!&lt;/p&gt;

&lt;p&gt;Remember that the app we're building will tell the user if their guess was exactly correct, too high, or too low. Right now we only give the user information on whether their guess was correct or incorrect.&lt;/p&gt;

&lt;p&gt;We can take advantage of else blocks to &lt;em&gt;chain&lt;/em&gt; together if statements by replacing that second &lt;code&gt;{ }&lt;/code&gt; (and its code) with another if statement as shown below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;guess&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; &lt;span class="n"&gt;secretNumber&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"You guessed the secret number!"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"The application will now close."&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;guess&lt;/span&gt; &lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;secretNumber&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"The number is lower than "&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="n"&gt;guess&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here we go directly from the &lt;code&gt;else&lt;/code&gt; statement into another if statement. This is entirely legal C# code and will only execute if the guess is &lt;em&gt;not&lt;/em&gt; the secretNumber.&lt;/p&gt;

&lt;p&gt;C# will then evaluate that second if statement and check &lt;code&gt;if (guess &amp;gt; secretNumber)&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;We haven't looked at &lt;code&gt;&amp;gt;&lt;/code&gt; before, but this is a comparison operator that evaluates to &lt;code&gt;true&lt;/code&gt; if the left side is greater than the right side and false otherwise. Similarly, there is also a &lt;code&gt;&amp;lt;&lt;/code&gt; operator for less than as well as &lt;code&gt;&amp;gt;=&lt;/code&gt; and &lt;code&gt;&amp;lt;=&lt;/code&gt; for greater than or equal to and less than or equal to.&lt;/p&gt;

&lt;p&gt;Now, if we run and guess 50, we'll see a message indicating that our guess was too high.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwj67350lmlyss3xmsupf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwj67350lmlyss3xmsupf.png" alt="Guess too high" width="800" height="418"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Accounting for All Possibilities
&lt;/h1&gt;

&lt;p&gt;Our code is still missing something, however. If the user guesses a number &lt;em&gt;below&lt;/em&gt; the secret number, they won't see a message. Let's add an &lt;code&gt;else&lt;/code&gt; to the end of our logic as shown below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Evaluate the player's guess and respond&lt;/span&gt;
&lt;span class="n"&gt;guess&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;guessText&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;guess&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; &lt;span class="n"&gt;secretNumber&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"You guessed the secret number!"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"The application will now close."&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;guess&lt;/span&gt; &lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;secretNumber&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"The number is lower than "&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="n"&gt;guess&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; 
&lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="c1"&gt;// If we got here guess must be &amp;lt; secretNumber&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"The number is greater than "&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="n"&gt;guess&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This finalized if / else chain handles cases where:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;guess&lt;/code&gt; is exactly equal to &lt;code&gt;secretNumber&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;guess&lt;/code&gt; is greater than &lt;code&gt;secretNumber&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;All other cases (less than &lt;code&gt;secretNumber&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now, no matter what the user enters, they should see a message letting them know how close their guess was.&lt;/p&gt;

&lt;h1&gt;
  
  
  Next Steps
&lt;/h1&gt;

&lt;p&gt;As you can see, we're starting to get to a workable application, but we're still missing a few key pieces.&lt;/p&gt;

&lt;p&gt;In the final tutorial of the series, we'll introduce random number generation, loops, and tie everything together into a single application.&lt;/p&gt;

&lt;p&gt;This article is based on abridged content from a few days in the first week of &lt;a href="https://www.TechElevator.com?utm_campaign=Homepage_Traffic&amp;amp;utm_medium=Homepage%20Referral&amp;amp;utm_source=GuessTheNumberCSharp" rel="noopener noreferrer"&gt;Tech Elevator's&lt;/a&gt; 14 week full stack C# development curriculum. Learn more about Tech Elevator, &lt;a href="https://www.techelevator.com/aptitude-test?utm_campaign=Get%20Started_Traffic&amp;amp;utm_medium=Get%20Started%20Page&amp;amp;utm_source=GuessTheNumberCSharp" rel="noopener noreferrer"&gt;take a free aptitude test&lt;/a&gt; to see if you might be a good match for development, or check out our other &lt;a href="https://www.techelevator.com/learn-to-code-resources" rel="noopener noreferrer"&gt;Learn to Code resources&lt;/a&gt;&lt;/p&gt;

</description>
      <category>csharp</category>
      <category>dotnet</category>
      <category>tutorial</category>
      <category>beginners</category>
    </item>
    <item>
      <title>How to Build a Game &amp; Learn C#: Adding Variables &amp; Expressions</title>
      <dc:creator>Matt Eland</dc:creator>
      <pubDate>Tue, 23 Feb 2021 14:30:03 +0000</pubDate>
      <link>https://dev.to/techelevator/how-to-build-a-game-learn-c-adding-variables-expressions-2ef4</link>
      <guid>https://dev.to/techelevator/how-to-build-a-game-learn-c-adding-variables-expressions-2ef4</guid>
      <description>&lt;p&gt;Last time we got started learning C# by creating a new C# project.&lt;/p&gt;

&lt;p&gt;When we last left off, our code looked something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;System&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;GuessTheNumber&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Program&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Main&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Hello World!"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's fine for making sure our code runs, but let's see what else we can do on our way to making a larger project.&lt;/p&gt;

&lt;p&gt;In this tutorial we'll take the code from the previous tutorial in this series and introduce variables and expressions.&lt;/p&gt;

&lt;p&gt;This article is also available in video form:&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/635uaNaaf1w"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: This series is based loosely on some of the content from the 1st week of &lt;a href="https://www.TechElevator.com?utm_campaign=Homepage_Traffic&amp;amp;utm_medium=Homepage%20Referral&amp;amp;utm_source=GuessTheNumberCSharp" rel="noopener noreferrer"&gt;Tech Elevator&lt;/a&gt;'s 14 week C# curriculum&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Variables
&lt;/h1&gt;

&lt;p&gt;Right now, when we run our code it displays the message "Hello World" as pictured below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fopjy95ur7qlgm51lslvk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fopjy95ur7qlgm51lslvk.png" alt="Hello World Application" width="800" height="418"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's make this do something a bit more than that.&lt;/p&gt;

&lt;p&gt;Change your &lt;code&gt;Main&lt;/code&gt; method to match the following code and run your application again:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;        &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Main&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Hello Variables!"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

            &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, when we run the application we should see something like the following:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fgbym9ginhta0zxswlyyl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fgbym9ginhta0zxswlyyl.png" alt="Hello Variables" width="800" height="418"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What we've done here is create a &lt;em&gt;string&lt;/em&gt; &lt;em&gt;variable&lt;/em&gt; named &lt;code&gt;message&lt;/code&gt; and then set it equal to &lt;code&gt;"Hello Variables!"&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In programming, a &lt;em&gt;string&lt;/em&gt; refers to a sequence of letters, numbers, or other characters. Strings can be anything from a single letter to the entire contents of a book. For simplicity's sake, when you think of a string, think "some text".&lt;/p&gt;

&lt;p&gt;A &lt;em&gt;variable&lt;/em&gt;, on the other hand, is something that holds on to some value, whether that is a number, a string, or potentially more complex things like classes or lists of data.&lt;/p&gt;

&lt;h1&gt;
  
  
  Understanding Expressions
&lt;/h1&gt;

&lt;p&gt;Variables can be read from and written to. Here, when we say &lt;code&gt;string message = "Hello Variables!";&lt;/code&gt;, we're both creating a variable and writing an initial value to it.&lt;/p&gt;

&lt;p&gt;Conversely, when we say &lt;code&gt;Console.WriteLine(message);&lt;/code&gt; we're &lt;em&gt;reading&lt;/em&gt; the current value for the &lt;code&gt;message&lt;/code&gt; variable when it gets to that line.&lt;/p&gt;

&lt;p&gt;These things are referred to as &lt;em&gt;expressions&lt;/em&gt;. When C# runs your code, it evaluates the contents of each line as an expression. When it sees &lt;code&gt;Console.WriteLine(message)&lt;/code&gt; it will evaluate the things inside of those parentheses to get their current value.&lt;/p&gt;

&lt;p&gt;When your program sees &lt;code&gt;message&lt;/code&gt;, it substitutes the current value of the &lt;code&gt;message&lt;/code&gt; variable so the code being executed looks like &lt;code&gt;Console.WriteLine(**"Hello Variables!"**);&lt;/code&gt; which is why we saw the message we saw.&lt;/p&gt;

&lt;h1&gt;
  
  
  Integer Expressions
&lt;/h1&gt;

&lt;p&gt;Okay, now that you have some understanding of variables and expressions, let's explore those a little bit more by looking at a different data type: the &lt;em&gt;integer&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Integers are whole numbers without the possibility of any decimal places (.NET also has data types which support decimal places, but we will not explore these in this article). In C#, we represent integers with the &lt;code&gt;int&lt;/code&gt; keyword, much like we used &lt;code&gt;string&lt;/code&gt; to represent some text.&lt;/p&gt;

&lt;p&gt;Let's create two integer variables, display them to the screen, and then display the results of adding the two numbers together.&lt;/p&gt;

&lt;p&gt;After the existing &lt;code&gt;Console.WriteLine(message);&lt;/code&gt; but before the &lt;code&gt;}&lt;/code&gt; that indicates the end of the method, add the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;            &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

            &lt;span class="c1"&gt;// Integer Variables&lt;/span&gt;
            &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;num1&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;4&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;num2&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

            &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"First Number: "&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="n"&gt;num1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Second Number: "&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="n"&gt;num2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

            &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;num1&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="n"&gt;num2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Result: "&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When you run, you should see something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F2f4osxeoggx6got32nvv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F2f4osxeoggx6got32nvv.png" alt="The program listing the first and second number plus the result of adding the two of them together" width="800" height="418"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding Integer Expressions
&lt;/h2&gt;

&lt;p&gt;Let's look over that new code line by line.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Console.WriteLine();&lt;/code&gt; is similar to code we've seen before, but instead of writing a message, it just adds an empty line to the console. This lets us space out our results so things are a bit more readable.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;// Integer Variables&lt;/code&gt; is a &lt;em&gt;comment&lt;/em&gt;. When C# sees the &lt;code&gt;//&lt;/code&gt; characters together, it ignores everything to the right of it on that current line. This lets you write helpful notes while you organize your code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Combining Expression Types
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;num1&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;4&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;num2&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here we declare two integer variables named &lt;code&gt;num1&lt;/code&gt; and &lt;code&gt;num2&lt;/code&gt;, then assign &lt;code&gt;4&lt;/code&gt; into the first and &lt;code&gt;2&lt;/code&gt; into the latter. This is very similar to our &lt;code&gt;message&lt;/code&gt; variable earlier, but the syntax is different since we're working with numbers and not text.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"First Number: "&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="n"&gt;num1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Second Number: "&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="n"&gt;num2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here we're writing out two values to the console. What's different about this is that we're using &lt;code&gt;+&lt;/code&gt; to add two things together. &lt;/p&gt;

&lt;p&gt;Here we add the string &lt;code&gt;"First Number: "&lt;/code&gt; to the current value of &lt;code&gt;num1&lt;/code&gt;. When this code runs, num1 is evaluated and replaced with its value, so the line effectively becomes &lt;code&gt;"First Number: " + 4&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;C# knows how to add a string and an integer together. It does this by converting the number 4 to a string and then adding it to the end of the first string, so our final expression becomes &lt;code&gt;"First Number: 4"&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding Integers
&lt;/h2&gt;

&lt;p&gt;Similarly to how we can add integers and strings, we can also add integers together.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;int result = num1 + num2;&lt;/code&gt; declares a new integer variable named &lt;code&gt;result&lt;/code&gt; and sets it equal to the current value of &lt;code&gt;num1&lt;/code&gt; plus the current value of &lt;code&gt;num2&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;When this line executes, it is evaluated as &lt;code&gt;int result = 4 + 2;&lt;/code&gt; which then combines to &lt;code&gt;int result = 6;&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Important Note:&lt;/em&gt; Even if we were to set &lt;code&gt;num2&lt;/code&gt; to some other value after we declared the &lt;code&gt;result&lt;/code&gt; variable, &lt;code&gt;result&lt;/code&gt; does not change since it only looked at the value of &lt;code&gt;num1&lt;/code&gt; and &lt;code&gt;num2&lt;/code&gt; at the time it was created. This is why we stress &lt;em&gt;current value&lt;/em&gt; when looking at expressions.&lt;/p&gt;

&lt;h1&gt;
  
  
  Next Steps
&lt;/h1&gt;

&lt;p&gt;Now that we have a basic understanding of what variables and expressions are and some familiarity with the &lt;code&gt;string&lt;/code&gt; and &lt;code&gt;int&lt;/code&gt; data types, we have the groundwork needed to start exploring user input.&lt;/p&gt;

&lt;p&gt;All of these things are important as we work towards building our final application: a "guess the number" game.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fbhptdmywoaiu9a7ax0lu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fbhptdmywoaiu9a7ax0lu.png" alt="A Screenshot of the Application" width="800" height="418"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This article is based on abridged content from a few days in the first week of &lt;a href="https://www.TechElevator.com?utm_campaign=Homepage_Traffic&amp;amp;utm_medium=Homepage%20Referral&amp;amp;utm_source=GuessTheNumberCSharp" rel="noopener noreferrer"&gt;Tech Elevator's&lt;/a&gt; 14 week full stack C# development curriculum. Learn more about Tech Elevator, &lt;a href="https://www.techelevator.com/aptitude-test?utm_campaign=Get%20Started_Traffic&amp;amp;utm_medium=Get%20Started%20Page&amp;amp;utm_source=GuessTheNumberCSharp" rel="noopener noreferrer"&gt;take a free aptitude test&lt;/a&gt; to see if you might be a good match for development, or check out our other &lt;a href="https://www.techelevator.com/learn-to-code-resources?utm_campaign=Homepage_Traffic&amp;amp;utm_medium=Homepage%20Referral&amp;amp;utm_source=GuessTheNumberCSharp" rel="noopener noreferrer"&gt;Learn to Code resources&lt;/a&gt;&lt;/p&gt;

</description>
      <category>csharp</category>
      <category>dotnet</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>An Open Letter to Our Bootcamp Grads</title>
      <dc:creator>Matt Eland</dc:creator>
      <pubDate>Thu, 13 Aug 2020 15:50:49 +0000</pubDate>
      <link>https://dev.to/techelevator/an-open-letter-to-our-bootcamp-grads-48mf</link>
      <guid>https://dev.to/techelevator/an-open-letter-to-our-bootcamp-grads-48mf</guid>
      <description>&lt;p&gt;&lt;em&gt;This is an open letter to Cohort 11 of &lt;a href="https://www.TechElevator.com" rel="noopener noreferrer"&gt;Tech Elevator&lt;/a&gt;‘s Columbus Campus. &lt;a href="https://www.TechElevator.com" rel="noopener noreferrer"&gt;Tech Elevator&lt;/a&gt; is a 14 week programming bootcamp teaching .NET or Java, SQL, HTML, CSS, JavaScript, and Vue.js. This particular cohort was the first class I was privileged to teach software development to.&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Congratulations, You did it!
&lt;/h2&gt;

&lt;p&gt;As graduates of &lt;a href="https://www.TechElevator.com" rel="noopener noreferrer"&gt;Tech Elevator&lt;/a&gt;, you have completed a very intense 14 week programming bootcamp designed to help you understand and be able to apply fundamental programming concepts on back end API servers, front end websites, and the databases that power them.&lt;/p&gt;

&lt;p&gt;First of all, it has been my immense pleasure to teach you and invest in you this past quarter of a year. As an instructor, I do what I do for the pleasure of seeing people move on to achieve great things and continue to learn and grow. Sadly, this means that there is a date that people do move on and I must say goodbye, but I know it is just “goodbye for now”.&lt;/p&gt;

&lt;p&gt;Secondly, your journey is not yet done. We teach you as much information as you can reasonably retain (and then a bit more) over 14 weeks, and I firmly believe your education was better than what I got from my own 4 year degree. However, even if I could teach you every single thing I’ve learned from two decades of professional development, technology would have changed significantly by the time we were done going over it.&lt;/p&gt;

&lt;p&gt;We teach you programming, but we also teach you how to learn more about programming and how to continue to learn and grow. You will need to continuously keep learning on your job for literally your entire career in development. You may think this is an exaggeration, but every night this past week I have learned something new about JavaScript development over the course of explicitly practicing software development while working on side projects.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep Practicing
&lt;/h2&gt;

&lt;p&gt;One of my esteemed colleagues says simply to “code every day”. He’s not wrong. As a new developer, without regular practice your skills will deteriorate and it will become more difficult to remember exact syntax, class names, method signatures, etc. These things do become much harder to forget with regular practice and so I implore you to continue to practice regularly.&lt;/p&gt;

&lt;p&gt;I like to try to convey to new developers that &lt;em&gt;programming is fun&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;It really is.&lt;/p&gt;

&lt;p&gt;It’s hard to convey that in an intense bootcamp where we give you a lot of homework and projects to help you build the muscles you’ll need to succeed as a developer, but the reality is that programming is an act of creating something out of an idea, ingenuity, and determination.&lt;/p&gt;

&lt;p&gt;So, pick something fun to build and start building it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep Learning
&lt;/h2&gt;

&lt;p&gt;You’ll find new things to learn and what ways of structuring applications work and what ways don’t. You’ll see what you like and what you don’t and be able to continuously grow your skills until you can take on larger and more complex tasks. And, if you’re looking for some ideas of things to continue to learn, I have a few areas to consider:&lt;/p&gt;

&lt;h3&gt;
  
  
  C#
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.freecodecamp.org/news/spread-operator-and-rest-parameter-in-javascript-es6-4416a9f47e5e/" rel="noopener noreferrer"&gt;LINQ&lt;/a&gt; (The syntax with the arrow functions, not the other syntax)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.microsoft.com/en-us/ef/core/get-started/?tabs=visual-studio" rel="noopener noreferrer"&gt;Entity Framework&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.microsoft.com/en-us/aspnet/web-pages/overview/getting-started/introducing-razor-syntax-c" rel="noopener noreferrer"&gt;MVC Razor Views&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/async/" rel="noopener noreferrer"&gt;Async / Await &amp;amp; Task&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  JavaScript
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Using &lt;a href="https://www.freecodecamp.org/news/spread-operator-and-rest-parameter-in-javascript-es6-4416a9f47e5e/" rel="noopener noreferrer"&gt;Rest and Spread Operators&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.freecodecamp.org/news/javascript-classes-tutorial/" rel="noopener noreferrer"&gt;Classes&lt;/a&gt; and &lt;a href="https://www.freecodecamp.org/news/javascript-prototype-explained-with-examples/" rel="noopener noreferrer"&gt;Prototype&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.freecodecamp.org/news/what-is-typescript/" rel="noopener noreferrer"&gt;TypeScript&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Vue.js
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Vuex &lt;a href="https://vuex.vuejs.org/guide/actions.html" rel="noopener noreferrer"&gt;Actions&lt;/a&gt; and &lt;a href="https://vuex.vuejs.org/guide/modules.html" rel="noopener noreferrer"&gt;Modules&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;Routing with &lt;a href="https://router.vuejs.org/guide/essentials/named-views.html" rel="noopener noreferrer"&gt;Named Views&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Vue &lt;a href="https://vuejs.org/v2/guide/computed.html#Watchers" rel="noopener noreferrer"&gt;Watchers&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Git
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.atlassian.com/git/tutorials/using-branches" rel="noopener noreferrer"&gt;Branches&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.atlassian.com/git/tutorials/making-a-pull-request" rel="noopener noreferrer"&gt;Pull Requests&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  CSS
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.w3schools.com/sass/sass_intro.asp" rel="noopener noreferrer"&gt;SASS / SCSS&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;
&lt;a href="https://getbootstrap.com/docs/4.0/getting-started/introduction/" rel="noopener noreferrer"&gt;Bootstrap&lt;/a&gt; (Check out the components on the left sidebar) &lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Closing
&lt;/h2&gt;

&lt;p&gt;There’s so much more out there to learn, and you will feel overwhelmed and like an impostor out there interviewing and on your first, second, third, fourth, and fifth jobs. It gets better over time, but understand that this is normal. We do not expect you to know everything because technology is broad, deep, and continuously expanding. We do expect you to be able to continue to learn and grow.&lt;/p&gt;

&lt;p&gt;This message is long already, and so I will close simply by saying that I am so very proud of what you’ve accomplished, I will miss you greatly, and I believe in you – perhaps more than you may believe in yourself at times.&lt;/p&gt;

&lt;p&gt;Go and build awesome things.&lt;/p&gt;




&lt;p&gt;The post &lt;a href="https://killalldefects.com/2020/08/13/an-open-letter-to-our-bootcamp-grads/" rel="noopener noreferrer"&gt;An Open Letter to Our Bootcamp Grads&lt;/a&gt; appeared first on &lt;a href="https://killalldefects.com" rel="noopener noreferrer"&gt;Kill All Defects&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>career</category>
      <category>bootcamp</category>
      <category>csharp</category>
      <category>javascript</category>
    </item>
    <item>
      <title>How to Build a Game &amp; Learn C#: Self-Paced Workshop - Getting Started</title>
      <dc:creator>Matt Eland</dc:creator>
      <pubDate>Fri, 12 Jun 2020 21:17:00 +0000</pubDate>
      <link>https://dev.to/techelevator/learn-c-by-building-a-guess-the-number-game-abh</link>
      <guid>https://dev.to/techelevator/learn-c-by-building-a-guess-the-number-game-abh</guid>
      <description>&lt;h1&gt;
  
  
  Overview
&lt;/h1&gt;

&lt;p&gt;In this short series of articles you'll follow step-by-step basics to learn the fundamentals of C# programming by building a "guess the number" game.&lt;/p&gt;

&lt;p&gt;This tutorial is intended for people who are interested in learning to code for the first time, but it will also be helpful to those coming to C# from another programming language.&lt;/p&gt;

&lt;p&gt;If video learning is more your thing, this content is also available in video form.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/t9U3wBkgtdc"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  The App You'll Build
&lt;/h2&gt;

&lt;p&gt;We'll be building a game in which the player is asked to guess a number between 1 and 100. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fbhptdmywoaiu9a7ax0lu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fbhptdmywoaiu9a7ax0lu.png" alt="A Screenshot of the Application" width="800" height="418"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Each time the player guesses a number, the game will tell you if your guess is too low or too high. The game will continue to run until you correctly guess the randomly-generated number.&lt;/p&gt;

&lt;h2&gt;
  
  
  Learning Objectives
&lt;/h2&gt;

&lt;p&gt;Over the course of this series you'll get a glimpse of &lt;a href="https://www.TechElevator.com?utm_campaign=Homepage_Traffic&amp;amp;utm_medium=Homepage%20Referral&amp;amp;utm_source=GuessTheNumberCSharp" rel="noopener noreferrer"&gt;Tech Elevator's&lt;/a&gt; 14 week full-stack C# / JavaScript curriculum and learn:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What C#, .NET, and Visual Studio are&lt;/li&gt;
&lt;li&gt;How to Create a New Project in Visual Studio&lt;/li&gt;
&lt;li&gt;What variables are and how to create and use them&lt;/li&gt;
&lt;li&gt;How to display text to the user and get a response&lt;/li&gt;
&lt;li&gt;Expressions and how code works when running&lt;/li&gt;
&lt;li&gt;Executing conditional logic with if statements&lt;/li&gt;
&lt;li&gt;Doing repetitive logic with loops&lt;/li&gt;
&lt;li&gt;Generating random numbers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This specific article covers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Installing Visual Studio&lt;/li&gt;
&lt;li&gt;What C# and .NET are&lt;/li&gt;
&lt;li&gt;Creating and Running your first C# program in Visual Studio&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;In order to follow along with this article, you need to first download and install Visual Studio on your PC or Mac.&lt;/p&gt;

&lt;p&gt;The latest version of Visual Studio is &lt;a href="https://visualstudio.microsoft.com/downloads/" rel="noopener noreferrer"&gt;available online&lt;/a&gt;, and the Community version is free and perfect for those learning a new language.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;em&gt;NOTE&lt;/em&gt;: Make sure you download &lt;em&gt;Visual Studio&lt;/em&gt; and not &lt;em&gt;Visual Studio Code&lt;/em&gt; as these are two separate products. As of the time of this writing, the latest version of Visual Studio is 2019&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;When installing Visual Studio, you will be provided with many choices for things to install. In general, the defaults are good, but the important thing for this article is to make sure that &lt;em&gt;.NET desktop development&lt;/em&gt; is checked as pictured below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fxxfk9z97lbf298vea1y0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fxxfk9z97lbf298vea1y0.png" alt="Visual Studio Installer with .NET desktop development selected" width="800" height="402"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Introducing C# and .NET
&lt;/h1&gt;

&lt;p&gt;The program we'll be creating today uses the C# programming language. C# is the flagship programming language of Microsoft's .NET development platform. &lt;/p&gt;

&lt;p&gt;C# was released in 2001 as a modern object-oriented programming language inspired by C++ and Java. Using C# we can develop mobile, desktop, and web applications.&lt;/p&gt;

&lt;p&gt;C# runs on the .NET platform and can talk to code written in other .NET programming languages, such as F# or Visual Basic .NET.&lt;/p&gt;

&lt;p&gt;You'll hear the terms .NET Core, .NET Framework, and .NET 5 (and beyond) thrown around. Each one of these is a different version of .NET. This article is written using .NET Core which is the latest version of .NET as of the time of this article. However, these concepts and code translate well to other versions of .NET.&lt;/p&gt;

&lt;h1&gt;
  
  
  Creating the Application
&lt;/h1&gt;

&lt;p&gt;Open Visual Studio and choose to create a new project.&lt;/p&gt;

&lt;p&gt;When prompted, find the &lt;em&gt;Console App (.NET Core)&lt;/em&gt; option in the list of projects. Make sure that C# appears in the icon and list of tags as pictured below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7xeytitqkbdka1bnensj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7xeytitqkbdka1bnensj.png" alt="New Project Dialog with Console App (.NET Core) Selected" width="800" height="531"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click Next to continue.&lt;/p&gt;




&lt;p&gt;From there, you will be prompted to name your project and select where it should be stored on your machine. The name and location don't matter, but I'm using &lt;code&gt;GuessTheNumber&lt;/code&gt; for mine.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ft0u37pz3fsx714ixjsxz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ft0u37pz3fsx714ixjsxz.png" alt="New Project Dialog with Project Name and Location" width="800" height="531"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click Create when ready and your project will be created.&lt;/p&gt;




&lt;p&gt;If you followed the previous steps, you should now see something like the following if you're running on Windows:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ft0u37pz3fsx714ixjsxz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ft0u37pz3fsx714ixjsxz.png" alt="Visual Studio 2019 displaying a Hello World code listing" width="800" height="531"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You'll see something like this if you're on a Mac:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F9kq6l8rme0ik2jrvpln1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F9kq6l8rme0ik2jrvpln1.png" alt="Visual Studio 2019 for Mac displaying a Hello World listing" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Understanding our Program
&lt;/h1&gt;

&lt;p&gt;Let's take a look at the code that Visual Studio generated in more detail:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;System&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;GuessTheNumber&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Program&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Main&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Hello World!"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We start with the &lt;code&gt;using System;&lt;/code&gt; statement. &lt;code&gt;using&lt;/code&gt; is how C# knows what other pieces of code are going to be needed for this specific file. In this case, we want the &lt;code&gt;System&lt;/code&gt; &lt;em&gt;namespace&lt;/em&gt; so we can use &lt;code&gt;Console&lt;/code&gt; later on in this file.&lt;/p&gt;

&lt;p&gt;The next line, &lt;code&gt;namespace GuessTheNumber&lt;/code&gt;, contains a &lt;em&gt;namespace&lt;/em&gt; with the name of our project in it. This would be used by other code to add &lt;code&gt;using&lt;/code&gt; statements to pull in our code. However, in this article we'll only be working with this single file.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;class program&lt;/code&gt; declaration and its opening and closing &lt;code&gt;{}&lt;/code&gt;'s denotes a &lt;em&gt;class&lt;/em&gt;. A class is too complex to get into in an introductory article (we dedicate over a week of curriculum at &lt;a href="https://www.TechElevator.com?utm_campaign=Homepage_Traffic&amp;amp;utm_medium=Homepage%20Referral&amp;amp;utm_source=GuessTheNumberCSharp" rel="noopener noreferrer"&gt;Tech Elevator&lt;/a&gt; to the things you can do with classes).&lt;/p&gt;

&lt;p&gt;For now, know that classes can be used to organize related pieces of code. In this case the &lt;code&gt;Program&lt;/code&gt; class represents the application we are writing.&lt;/p&gt;

&lt;p&gt;Next, we have a particularly frightening &lt;code&gt;static void Main(string[] args)&lt;/code&gt; line. This is syntax defining a &lt;em&gt;method&lt;/em&gt; named Main that can be run by other code. The main method is a special method that will be run when we run our application.&lt;/p&gt;

&lt;p&gt;Later on in programming we use different methods to organize pieces of code and calculate and return values, but for now, think of Main as the thing that will be executed when your program runs.&lt;/p&gt;

&lt;p&gt;Finally, we see &lt;code&gt;Console.WriteLine("Hello World!");&lt;/code&gt;. This line tells .NET to display a message on the command line when the program is run.&lt;/p&gt;

&lt;h1&gt;
  
  
  Hello World
&lt;/h1&gt;

&lt;p&gt;Let's run the program now and see how it works.&lt;/p&gt;

&lt;p&gt;In order to run your program, click the green arrow in your toolbar as pictured below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F9mdxdlrtwa32eca9y4hj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F9mdxdlrtwa32eca9y4hj.png" alt="Running Our Code in Visual Studio" width="800" height="406"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once you click run, Visual Studio will show some new windows to indicate that it is building your application. This will take a few seconds, but once complete you should see a window appear with the text "Hello World":&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fopjy95ur7qlgm51lslvk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fopjy95ur7qlgm51lslvk.png" alt="Hello World Application" width="800" height="418"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Congratulations! You just created and ran your first program.&lt;/p&gt;

&lt;h1&gt;
  
  
  Next Steps
&lt;/h1&gt;

&lt;p&gt;In the next article, we'll discuss variables and expressions and how .NET evaluates our code when the application runs.&lt;/p&gt;

&lt;p&gt;If you're looking for more resources, including videos, articles, and even a learn to code aptitude test, check out Tech Elevator's &lt;a href="https://www.TechElevator.com?utm_campaign=Homepage_Traffic&amp;amp;utm_medium=Homepage%20Referral&amp;amp;utm_source=GuessTheNumberCSharp" rel="noopener noreferrer"&gt;Learn to Code&lt;/a&gt; program.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>dotnet</category>
      <category>csharp</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
