Kickstart your programming journey with our Developer Bootcamp designed specifically for beginners. Learn to code using C#, one of the most powerful and versatile languages in the industry. This hands-on course covers all the essential programming concepts, from basic syntax to advanced object-oriented programming (OOP) principles, SOLID principles and how to store and retrieve data from a SQLite database. You'll dive into strings, numbers, arrays, list collections, conditional logic, functional programming, exception handling, and more, gaining the skills to build real-world applications. You'll also learn how to use GitHub by using Git from your local PC to a remote repository. You'll also learn some advance topics regarding security, how to implement authentication and authorization, unit testing and TDD, and how to write API's and essentials regarding hosting a web application.
Kickstart your programming journey with our Developer Bootcamp designed specifically for beginners. Learn to code using C#, one of the most powerful and versatile languages in the industry. This hands-on course covers all the essential programming concepts, from basic syntax to advanced object-oriented programming (OOP) principles, SOLID principles and how to store and retrieve data from a SQLite database. You'll dive into strings, numbers, arrays, list collections, conditional logic, functional programming, exception handling, and more, gaining the skills to build real-world applications. You'll also learn how to use GitHub by using Git from your local PC to a remote repository. You'll also learn some advance topics regarding security, how to implement authentication and authorization, unit testing and TDD, and how to write API's and essentials regarding hosting a web application.
By the end of this course, you'll create a fully functional web application using ASP.NET Core, complete with database integration and image handling. Whether you're aiming to start a career in software development or simply want to learn a new skill, this bootcamp provides the foundation you need to succeed.
No prior programming experience is required—just bring your enthusiasm to learn. Join us and transform your ideas into working code.
Instructor ratings are instrumental in establishing the credibility and effectiveness of courses on this platform.
A positive rating not only acknowledges the instructor's expertise but also helps prospective students make informed decisions about their learning journey. For instructors, high ratings can open up more opportunities, attract a broader audience, and contribute to the overall success of their teaching endeavors.
We understand that not every course may be a perfect fit for every student. If you find that a course doesn't align with your learning objectives or preferences, we encourage you to reach out to us for a refund.
Our priority is your satisfaction and successful learning experience. However, we kindly request that if a course is not suitable for you, consider providing constructive feedback directly to the instructor or through our support channels.
Leaving a negative rating without communication may adversely impact the instructor's reputation, and they may not have the chance to address your concerns or enhance the course based on valuable feedback.
Your feedback is essential in maintaining a vibrant learning community, and we appreciate your cooperation in fostering an environment where both students and instructors can thrive. Together, we can ensure the continued excellence of our educational platform.
Test your knowledge of software development 101 theory
To install the .NET SDK on Windows, you can follow these steps:
1.Check System Requirements: Before you begin, ensure that your system meets the minimum requirements for the .NET SDK. You can find the requirements on the official Microsoft documentation. https://dotnet.microsoft.com/en-us/download
2.Download the .NET SDK: Visit the official .NET download page at https://dotnet.microsoft.com/download and select the SDK version you want to install. Click on the "Download x64" (or x86 if you are using a 32-bit system) link.
3.Run the Installer: Once the installer is downloaded, run the executable file to start the installation process.
4.Follow the Installation Wizard: The installation wizard will guide you through the process. You may be prompted to accept the license agreement, choose the installation location, and select optional components. Follow the on-screen instructions.
5.Install Visual Studio Code (Optional): If you prefer using a lightweight code editor, you can install Visual Studio Code. It's not mandatory, but it provides a great development environment for .NET projects.
6.Verify Installation: After the installation is complete, open a new command prompt or PowerShell window and run the following command to verify that the SDK is installed:
7.bashCopy code
8.dotnet --version
9.This command should display the installed .NET SDK version.
1.Download Visual Studio Code: Go to the official Visual Studio Code website at https://code.visualstudio.com/. Click on the "Download for Windows" button.
2.Run the Installer: Once the installer is downloaded, run the executable file to start the installation process.
3.Follow the Installation Wizard: The installation wizard will guide you through the process. You can choose the installation location and whether you want to add "Open with Code" and "Add to PATH" options. Follow the on-screen instructions.
4.Open Visual Studio Code: After the installation is complete, you can open Visual Studio Code. You can find it in the Start menu or on the desktop if you chose to create shortcuts during installation.
5.Install Extensions (Optional): Visual Studio Code supports extensions that enhance its functionality. You can install extensions for different programming languages, themes, and tools. Open the Extensions view by clicking on the Extensions icon in the Activity Bar on the side of the window (or use the shortcut Ctrl+Shift+X). Search for extensions and click the install button.
1.- .NET Extension Pack
2.- C# for Visual Studio Code
3.- C# Dev Kit extension
6.Verify Installation: Once Visual Studio Code is open, you can verify the installation by checking the version. Open the integrated terminal (View > Terminal or use the shortcut Ctrl+ backtick), and type:
7.bashCopy code
8.code --version
9.This command should display the installed Visual Studio Code version.
Install Extensions (Optional): Visual Studio Code supports extensions that enhance its functionality. You can install extensions for different programming languages, themes, and tools. Open the Extensions view by clicking on the Extensions icon in the Activity Bar on the side of the window (or use the shortcut Ctrl+Shift+X). Search for extensions and click the install button.
1. .NET Extension Pack
2. C# Dev Kit extension
1. Opening VS Code:
•After installation, open Visual Studio Code.
3. Basic Interface:
•Familiarize yourself with the VS Code interface:
•Explorer: File navigation on the left.
•Search: Search for files and text.
•Source Control: Version control (Git).
•Run and Debug: Run and debug your code.
•Extensions: Install and manage extensions.
4. Creating/Opening a Project:
•Use the "File" menu to create a new file or folder or open an existing project folder.
5. Editing Code:
•Use the main editor to write and edit code.
•VS Code supports syntax highlighting and auto-completion for various languages.
6. Terminal:
•Access the integrated terminal using Ctrl + backtick (Ctrl+` ).
•Run commands and scripts directly within VS Code.
7. Extensions:
•Explore and install extensions from the Extensions view (icon on the sidebar or Ctrl+Shift+X).
•Common extensions include language support, debuggers, and tools for specific frameworks.
8. Integrated Git:
•If your project is under version control, use the Source Control view to manage Git operations.
9. Run and Debug:
•Create a launch.json configuration for debugging.
•Use the "Run and Debug" view to start debugging sessions.
10. Settings:
•Adjust VS Code settings in the "Settings" view (icon on the sidebar or Ctrl+,).
•Configure global and workspace-specific settings.
11. Shortcuts:
•Learn useful keyboard shortcuts to enhance your productivity.
•Access the Keyboard Shortcuts reference (Ctrl+K Ctrl+S).
12. Themes and Color Themes:
•Customize the appearance of VS Code with different themes.
•Install themes from the Extensions view.
13. IntelliSense:
•Take advantage of intelligent code completion with IntelliSense.
14. Extensions Marketplace:
•Explore the Extensions Marketplace for a wide range of extensions to enhance your development experience.
15. Update VS Code:
•Regularly check for updates by clicking on the gear icon in the bottom left and selecting "Check for Updates."
This is a basic guide to get you started with Visual Studio Code. As you work with it, you'll discover additional features and capabilities that suit your specific development needs. The VS Code documentation is also an excellent resource for in-depth information: https://code.visualstudio.com/docs.
We will create a quick simple “Hello World” app in C#, printing “Hello World” to the screen
Use the “HelloWorld” App (code example in resources of this lecture - 1-HelloWorld.zip)
Define a new String
Call the variable myName
Set the variable to your name. E.g. “Charles”
Print out the variable to the screen
Use the “2-HelloWorld-String1” App (code example in resources of this lecture - 2-HelloWorld-String1.zip)
Create 2 string variables, firstFriend and secondFriend
Set firstFriend to John and secondFriend to Lisa
Print out the two variables to the screen by writing it to the console using a single line as shown in the Sample
Use the “3-HelloWorld-String2” App (code example in resources of this lecture - 3-HelloWorld-String2.zip)
The following sample will trim the Hello World string 3 different ways:
Trim spaces to the start
Trim spaces at the end
Trim all space in the front and end of the String
Use the “4-HelloWorld-String3” App (code example in resources of this lecture - 4-HelloWorld-String3.zip)
We’ll use the Replace method to replace “Hello” with “Greetings”
We’ll also change the Case of the string to upper and lower cases as shown in the Sample code
Use the “5-HelloWorld-String4” App (code example in resources of this lecture - 5-HelloWorld-String4.zip)
Create a app to search for words in a string
Create a String variable called songLyrics
1st search for goodbye in songLyrics, then search for greetings in songLyrics
Use the “6-HelloWorld-String5” App (code example in resources of this lecture - 6-HelloWorld-String5.zip)
The String Challenge:
There are two similar methods, StartsWith and EndsWith that also search for sub-strings in a string. These find a substring at the beginning or the end of the string. Try to modify the previous sample to use StartsWith and EndsWith instead of Contains. Search for "You" or "goodbye" at the beginning of a string. Search for "hello" or "goodbye" at the end of a string.
Note - Watch your punctuation when you test for the text at the end of the string. If the string ends with a period, you must check for a string that ends with a period.
You should get true for starting with "You" and ending with "hello" and false for starting with or ending with "goodbye".
Use the “7-HelloWorld-StringChallenge” App (code example in resources of this lecture - 7-HelloWorld-StringChallenge.zip) attached as a Resource to this lecture.
Here's a list of the common numeric types in C#:
1. Integral Types:
1.Integral types in C# are used to represent whole numbers.
2. Floating-Point Types:
Floating-point types in C# are used to represent real numbers with a fractional part.
3. Decimal Type:
The decimal type in C# is used for precise decimal floating-point arithmetic. It's suitable for financial calculations and scenarios requiring high precision
Here's a list of the common numeric types in C#:
Integral Types:
•sbyte (signed byte): Represents 8-bit signed integers (-128 to 127).
•byte (unsigned byte): Represents 8-bit unsigned integers (0 to 255).
•short (signed short): Represents 16-bit signed integers (-32,768 to 32,767).
•ushort (unsigned short): Represents 16-bit unsigned integers (0 to 65,535).
•int (signed integer): Represents 32-bit signed integers (-2,147,483,648 to 2,147,483,647).
•uint (unsigned integer): Represents 32-bit unsigned integers (0 to 4,294,967,295).
•long (signed long): Represents 64-bit signed integers (-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807).
•ulong (unsigned long): Represents 64-bit unsigned integers (0 to 18,446,744,073,709,551,615).
Floating-Point Types:
Floating-point types in C# are used to represent real numbers with a fractional part. They include:
•float: Represents 32-bit single-precision floating-point numbers. Suitable for a wide range of values with limited precision.
•double: Represents 64-bit double-precision floating-point numbers. Offers higher precision compared to float.
Decimal Type:
The decimal type in C# is used for precise decimal floating-point arithmetic. It's suitable for financial calculations and scenarios requiring high precision:
•decimal: Represents a 128-bit decimal data type. It provides high precision (28-29 significant digits) and a wide range (±1.0 x 10^(-28) to ±7.9 x 10^(28)).
Using multiple integers and adding values to a single integer
Exercise:
Use the “NumbersSample” App (code example in resources of this lecture - 1-Numbers.zip)
Create the int: a, b, and add a + b to c, and the write it to the console.
Mathematics operations with rules consistent with the rules you learned in mathematics.
Multiplication and division take precedence over addition and subtraction
Use the “NumbersSample” App (code example in resources of this lecture - 2-Numbers.zip)
You've seen the basic numeric types in C#: integers and doubles. There's one other type to learn: the decimal type. The decimal type has a smaller range but greater precision than double. Let's take a look:
decimal min = decimal.MinValue;
decimal max = decimal.MaxValue;
Console.WriteLine($"The range of the decimal type is {min} to {max}");
Use the “NumbersSample” App (code example in resources of this lecture - 3-Numbers.zip)
Write code that calculates the area of a circle whose radius is 2.50 centimeters. Remember that the area of a circle is the radius squared multiplied by PI.
One hint: .NET contains a constant for PI, Math.PI that you can use for that value. Math.PI, like all constants declared in the System.Math namespace, is a double value. For that reason, you should use double instead of decimal values for this challenge.
Answer: +- 19.63………
The solution is in the next lecture.
Use the “NumbersChallenge” App (code example in resources of this lecture - 4-Numbers_Challenge.zip)
Intro to Arrays
Single-dimensional arrays
Multidimensional arrays
Jagged arrays
Implicitly typed arrays
The Array Challenge
Sequence of like elements
Access an element via its index
The index is its ordinal position
The first element in the array is at index 0
E.g. int[] array = new int[5];
Use the “ArraysSample” App (code example in resources of this lecture - 1-Arrays.zip)
Arrays can have more than one dimension
For example, you can have two-, three- or four-dimensional arrays
Sample: Create the following sample code in a new project and run the app. (Sample code is in 2-Arrays.zip in this lectures resources)
In Jagged arrays, the elements are arrays, possibly of different sizes
Also called an "array of arrays"
Sample code is in 3-Arrays.zip in this lectures resources
The type of the array instance is inferred from the elements specified in the array initializer
Rules: Also apply to implicitly typed arrays
(Sample code is in 4-Arrays.zip in this lectures resources)
Write code to create a Product List, with name a price, and a Shopping cart, and print out the product list, and Shopping Cart with a total price.
Product List:
Create two arrays to store the names and prices of five products.
Use the following products: "Apple", "Banana", "Milk", "Bread", "Eggs“
Use the following Prices: 1.0, 0.5, 2.0, 1.5, 2.5 (Note, do not use $ signs in the Array)
Display the list of products and their prices. Add $ sign to the output
Shopping Cart:
Add an arrays for Shopping cart with values assign to it by entering its number that associate with the product.
Simulate adding three products to the shopping cart. E.g. "Apple", "Milk", "Bread",
Display the selected products and their total cost.
In all languages, you can use the if statement to confirm or check if a decision is valid
If the condition is true, you can execute a statement or perform any action
You can use various operands to compare two or more types.
1.Relational Operators:
== : Equal to
!= : Not equal to
> : Greater than
< : Less than
>= : Greater than or equal to
<= : Less than or equal to
2.Logical Operators:
&& : Logical AND
|| : Logical OR
! : Logical NOT
Bitwise Operators:
& : Bitwise AND
| : Bitwise OR
^ : Bitwise XOR
~ : Bitwise NOT
<< : Left shift
>> : Right shift
4.Equality and Inequality Operators:
== : Equal to
!= : Not equal to
5.Assignment Operators:
= : Assignment operator (be careful not to confuse this with the equality operator ==)
6.Ternary Conditional Operator:
condition ? true_expression : false_expression : This operator evaluates a condition and returns one of two expressions depending on whether the condition is true or false.
7.Grouping Parentheses:
( and ) : Parentheses are used to group expressions and control the order of evaluation.
Create the sample code in a new project and run the app. (Sample code is in 1_ConditionalLogic.zip in this lectures resources)
To execute different code in both the true and false branches, you create an else branch that executes when the condition is false.
Check sample 1 and 2. Sample 1 will work, but rather use Sample 2, because it uses better indentation and allow users to add multiple statement if the condition is true and multiple statements if the condition is false.
Create the sample code in a new project and run the app. (Sample code is in 2_ConditionalLogic.zip in this lectures resources)
A switch statement in C# is a control flow statement that allows for a variable to be tested against a list of values (cases).
Each case is a branch, and the variable being switched on is checked for each case.
When a match is found, the corresponding block of code is executed.
If no match is found, an optional default case can be executed.
Sample code is in 3_ConditionalLogic.zip in this lectures resources
Loops are an integral part of programming
Use loops to repeat statements to be executed more than once
Sample code is in 4_ConditionalLogic.zip in this lectures resources
The Do While loop executes the code first, and then checks the condition
Sample code is in 5_ConditionalLogic.zip in this lectures resources
For Loop is another commonly used loop statement
Sample code is in 6_ConditionalLogic.zip in this lectures resources
All type of loops can be nested inside another loop
Create the sample code in a new project and run the app. (Sample code is in 7_ConditionalLogic.zip in this lectures resources)
What is Generics in C#
Create lists
Modify list contents
Search and sort lists
Lists of other types
Challenge
A way to design classes, structures, interfaces, methods, and delegates
Placeholder for the data types
This is the way to define generics: generic<T>
generic = class, structure, interface, methods or delegates
T = data type, such as string, int, double, etc. or a class that represents an instance of an object
Examples
List<T>: Represents a strongly typed list of objects.
Example: List<int> intList = new List<int>();
Dictionary<TKey, TValue>: Represents a collection of key/value pairs.
Example: Dictionary<string, int> keyValuePairs = new Dictionary<string, int>();
Queue<T>: Represents a first-in, first-out (FIFO) collection of objects.
Example: Queue<string> queue = new Queue<string>();
Stack<T>: Represents a last-in, first-out (LIFO) collection of objects.
Example: Stack<double> stack = new Stack<double>();
A generic list type is represented by the List<T> class
It is part of the System.Collections.Generic namespace. You need to add a reference, by use the using command to use the library.
E.g. using System.Collections.Generic;
Create the sample code in a new project and run the app. Don’t forget the using (Sample code is in 1_ListCollection.zip in this lectures resources)
One important aspect of this List<T> type is that it can grow or shrink, enabling you to add or remove elements.
Step 1. Complete Sample 1 and add it to a new project. Run this and store the results.
Step 2. Add the second part
(Sample code is in 2_ListCollection.zip in this lectures resources)
C# allows you to search for items in a list
The IndexOf method searches for an item and returns the index of the item. If item is not in the list, IndexOf will return -1.
Step 1. Complete Sample 1 and add it to a new project. Run this and store the results.
Step 2. Add the second part
(Sample code is in 3_ListCollection.zip in this lectures resources)
Let’s use a list of number, using int
Complete Sample as per video and add it to a new project. Run this and store the results. (Sample code is in 4_ListCollection.zip in this lectures resources)
See if you can put together some of the concepts from this and earlier lessons.
Expand on what you've built so far with Fibonacci Numbers. (Use the previous project)
Try and write the code to generate the first 20 numbers in the sequence. (As a hint, the 20th Fibonacci number is 6765.)
The solution is available on the resources of this lecture. 5_ListCollection_Challenge.zip
Pattern matching and casting
Explicit Casting
Using as Operator
Null Checks
Using Key Value Pairs
Challenge
Pattern matching provides a safer and more expressive way to perform type casting
Casting is the process of converting a variable from one type to another.
In C#, there are two types of casting: explicit casting and the as operator.
The is operator checks if an object is of a certain type and, at the same time, can introduce a new variable of that type for further use.
Create the sample code in a new project and run the app. (Sample code is in 1_FuncProgram.zip in this lectures resources)
OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.
Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.
Find this site helpful? Tell a friend about us.
We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.
Your purchases help us maintain our catalog and keep our servers humming without ads.
Thank you for supporting OpenCourser.