Introduction to Namespaces in C#

Hello friends, I hope you all are doing great. In today's tutorial, we are gonna have a look at detailed Introduction to Namespaces in C#. Namespaces are considered as libraries in C#. If you have worked on any other programming language then you must be aware of the term library which contains all classes & methods etc. In C#, this functionality is performed by namespaces. In 12th tutorial, we have seen Introduction to Methods and in 13th part, we have seen Classes in C#. Methods are simple storage units and stores code only, Classes are slightly bigger storage units and can store methods. Now Namespaces are giant storage units, which can save anything in them i.e. classes, methods, namespaces etc. So, let's have a look at them in detail:

Introduction to Namespaces in C#

  • Namespaces are giant code storage units, can be referred as libraries in C#, and are used for optimization & orientation of the code.
  • Namespaces are included in the project with the help of using directive at the top.
  • If you look at our previous codes, then you will find using Systems; at the top of your code, basically this Systems is a namespace and with the help of using directive, we have included it in our project.
  • Console, which we use for printing our data, is a member of this System Namespace.
  • Our whole project is also placed between { } brackets of namespace TEPProject.
Why we need namespaces ?
  • Using Namespace, we can organize the code pretty well, it doesn't have much impact in simple projects but in complex projects, you can't ignore namespaces.
  • Throughout our course, we have discussed classroom data and in C# Classes lecture, I have asked you to get data of all classes of a school and now in namespace case, think of data coming from all schools of British School System.
  • So, in bigger projects, there's always a need to make different teams, which will be working on separate code departments.
  • In such cases, each team can create project with its own namespace and at the end you can use all those namespaces in your Main code and can get access to its functions etc. without disturbing each other's code.
Creating Namespaces in C#
  • So, now let's create two namespaces in our project for two different schools, named as SchoolA & SchoolB, as shown in below figure:
  • In above figure, you can see our first namespace structure is: Namespace SchoolA > Class TeamA > Method printSchoolName.
  • Our second namespace structure is: Namespace SchoolB > Class TeamB > Method printSchoolName.
  • Now in my Main function, which is in TEPProject Namespace, I am calling both of these printSchoolName Method.
  • In order to invoke the method in first namespace, I have used dot operator and the sequence is SchoolA.TeamA.printSchoolName();
  • For the second namespace, I have placed using SchoolB; at the top of the code and now we can call TeamB class directly and that's why I have used TeamB.printSchoolName(); to invoke method in second namespace.
  • So, we can use namespaces using these two ways and I prefer the second one as it makes the code smooth, we don't need to write SchoolB every time.
Create Project for Namespaces in C#
  • Now you got the idea of what are namespaces and how to use them in C#.
  • So now it's time to create separate projects for these two namespaces and you will see our code will become clear & simple.
  • Right click on your Project's Name in Solution Explorer and then click on Add and then click on New Item, as shown in below figure:
  • When you click on New Item, a new window will open and here you need to select C# class, as shown in below figure:
  • I have given it a name SchoolA.cs and then click Add Button.
  • Similarly, I have created a new project for second namespace SchoolB.cs and now my Solution Explorer is shown in below figure:
  • Both of my projects' codes and Main file code are shown in below figure:
  • Now you can see in the above figure that our codes are now quite simple & clear and we have created separate files for our new namespaces.
  • C# Classes created in separated files and namespaces are now accessible in our Main Function.
So, that was all about Namespaces in C#, I hope you have understood the main idea. In our next tutorial, we will have a look at Inheritance in C#. Till then take care and have fun !!! :)

Introduction to Classes in C#

Hello friends, I hope you all are doing great. In today's tutorial, we are gonna have a look at detailed Introduction to Classes in C#. It's my 13th tutorial in C# series and now we are ready to understand this slightly complex subject in C#. In our previous tutorial, we have seen Introduction to Methods in C# which are used for organizing the code and we can add some code in separate methods to make the Main method simple. Classes are slightly bigger storage capacities than methods. Methods can store code, classes can store methods. So, let's discuss classes in detail:

Introduction to Classes in C#

  • Classes in C# are referred as storage units for different methods, fields, objects etc. and are used for organizing the code.
  • In our previous lessons in C#, we have always taken an example of a classroom but what if we have to create a software for an entire school system.
  • In that case, we can create separate teams, dealing with each classroom, so you can think of that classroom as a class in C#.
  • Our Main method is in class Program, Let's create a new class for OLevel classroom students:
  • so, in the above figure, you can see that I have created a new class named OLevel and this class has 3 members, named as:
    • First one is field/variable named: FirstName.
    • Second one is field/variable named: SecondName.
    • Third one is method named: printStudentName.
  • So, we have 3 members in our newly created class and all these members are instance members as they don't have static keyword in their statement.
  • So, in order to call this OLevel method in Main method, we have created a new instance of OLevel class, as we did in our previous lecture on methods in C#.
  • After that using this new instance of OLevel class, we have invoked the printStudentName method using dot operator.
  • When we run our code, we have the Full Name : TEP C#, as given in the code.
  • You can also use Constructors & Destructors in C#, but they are not necessary to use, as we haven't used the constructor but our code worked fine.
  • So, let's have a look at what are these terms one by one:
C# Class Constructors
  • C# Class Constructor is a simple method / function, which gets executed automatically whenever the new instance of class is created.
  • It must have the same name as the class itself and it won't have a return type and the access modifier is public.
  • Constructors are normally used for initializing data fields or for initial settings of your class methods.
  • Let's create a Constructor for our OLevel class:
  • In above figure, you can see I have created a new method in our OLevel class and it has the same name OLevel.
  • Constructors can also have parameters, so if we want to send some data from one class to another class, we can use these constructor parameters.
  • So, now instead of hard coding the data in my new class, I am sending the data, when I am create new instance of class. i.e.

OLevel O1 = new OLevel ( " TEP " , " C# " );

  • So, that way I can send multiple data just by creating new instance of class.
  • You must have noticed that this C# Class Constructor doesn't have a static keyword in it so its an Instance Constructor.
  • So, we can also add a static Constructor in C# class, which don't have any access modifier or return type and just have static keyword in its definition and is executed before instance Constructor.
  • Moreover, Destructor in C# is used to clean up any resources used by the class and these destructors are called automatically by the garbage collector so we don't need to worry about them.
  • Destructors can't take any parameters and they doesn't have access modifier or return type, they just have a tilled sign ( ~ ) in front of them.
  • I have created static Constructor, Instance Constructor & Destructor in below code:
  • You can see in above figure, that static Constructor is called first and then instance Constructor is called and finally we printed the Full Name.
  • Here's the complete code used in this lecture:
using System; namespace TEPProject { class OLevel { string FirstName; string LastName; static OLevel() { // Static Constructor Console.WriteLine("\nStatic Constructor Called\n"); } public OLevel(string Name1, string Name2) { Console.WriteLine("Instance Constructor Called\n"); this.FirstName = Name1; this.LastName = Name2; } public void printStudentName() { Console.WriteLine("Full Name : {0} {1}\n\n", FirstName, LastName); } ~ OLevel() { // Destructor } } class Program { static void Main(string[] args) { Console.WriteLine("\n\nwww.TheEngineeringProjects.com"); OLevel O1 = new OLevel("TEP","C#"); O1.printStudentName(); } } }
So, that was all about Classes in C#, I hope you have understand their basic concept, we will gradually move towards complex codes. In the next session, we will have a look at Introduction to Namespaces in C#. Till then take care & have fun !!! :)

Introduction to Methods in C#

Hello friends, I hope you all are doing great. In today tutorial, I am going to give you a detailed Introduction to Methods in C#. It's our 12th tutorial in C# series. So far, we have covered all the basic concepts in C# and now it's time to move forward and have a look at some complex concepts. Methods have an important role in C# programming and if you want to be an efficient programmer then you must set your method controls correctly. Some methods have secret codes in them, which you don't want to give access to your developers, then you can set it private. We will cover such things in detail later, let's first have a look at Introduction to Methods in C#:

Introduction to Methods in C#

  • Methods in C#, also called Functions, are extremely useful in optimizing the code, normally used to create a logic once and use it repeatedly.
  • It happens in projects where you need to do a similar job at various places of your code.
  • In such conditions, it's wise to create a small function of your repeated code and instead of adding those lines again and again, simply call the function.
  • Here's the syntax of Methods in C#:
Access-Modifiers Return-Type Method-Name ( Parameters )  { // Method-Body } public void HelloWorld(){ Console.Write("Hello World !!!"); }
  • Access-Modifiers: Access Modifiers are used to control access capability of any method / function. You can set them public, protected or private etc. We will discuss them later in detail.
  • Return-Type: It decides what the method is gonna return, it could be void or any data type i.e. int, float, string etc.
  • Method-Name: It's the unique name of the Method / Function, which can't be any reserved keywords in C#. It's should be meaningful so you can remember later.
  • Parameters: Parameters are optional and are normally used to transfer data between methods.
  • There are two types of methods available in C#, which are:
    • Instance Method.
    • Static Method.
  • Let's discuss both of them separately, in detail:

Instance Method in C#

  • Those methods, which doesn't have static keyword in their definition are called Instance Methods in C#.
  • In order to call instance method in another method, we have to first create a new instance of that method and the invoke the method using dot operator.
  • Let's have a look at how to create and call an instance method in C#:
  • You must have realized by now that all the work we have been doing so far was in Main Method. That's the default method, the C# compiler first goes into and it's a static method as it has static keyword in it, which will discuss next.
  • So, now in above figure, I have created a new method and I have used public (access-modifier) and void (return-type) and the Method-Name is PrintNames. I am using studentsNames array as a parameter.
  • I have used the same code which we have designed in our previous lecture on For Loop in C#, so I have placed the foreach loop in my newly created instance method named PrintNames.
  • Now in order to call this new method in Main method, I have to first create a new instance of this method's class and you must have noticed that the class name is Program at the top.
  • Both of our Main & PrintNames Methods are placed inside Program class.
  • So, in our Main function, I have first created a new instance of my class Program using new keyword:

Program P = new Program ( );

  • After that, using this class instance P, I have invoked the PrintNames method using dot operator ( . ).

P.PrintNames ( studentsNames ) ;

  • When you are calling your method, make sure you enter the parameters correctly as specified in its definition otherwise compiler will generate an error.
  • You can specify multiple parameters separated by commas.
  • So, that's how we can create and call an instance method, so now let's have a look at How to call static method in C#.

Static Method in C#

  • Those methods, which have static keyword in its definition are called static methods in C#.
  • In order to call a static method, we don't need to create a new instance of Program class.
  • Instead, we can directly invoke a static method from Program class using dot operator ( . ), as shown in below figure:
  • In above figure, I have created a new method called PrintNames2 and I have used static keyword in its definition, so its a static method in C#.
  • So, now in order to call that method, I have used the name of class and then invoked the method using dot operator, using below code:

Program.PrintNames2 ( stringNames );

  • We don't need to create a new instance of class for static method, that's the difference between static and instance methods in C#.
So, that was all about Methods in C# and I hope you have understood the difference between static and instance methods and how to invoke them. In the next lecture, we will have a look at Introduction to Namespace in C#, which is another important concept in C#. Till then take care & have fun !!! :)

How to use for Loop in C#

Hello friends, I hope you all are doing great. In today's tutorial, we are gonna have a look at How to use For Loop in C#. It's our 11th tutorial in C# series. Till now, we have seen two loops in C# which are IF Loop and while Loop and today we are gonna have a look at for Loop. For Loop is most commonly used loop in any programming language and if you have worked on any other language then you must be aware of its syntax. It is used to create repeated loop with specified number. Let's have a look at it in detail:

How to use for Loop in C#

  • For loop in C# takes an integer variable as a Controlling agent, initialized at value V1 and ends at value V2, and the travel from value V1 to V2 depends on the Condition specified in () brackets.
  • In both IF loop & while loop, the small brackets just have single argument, but in for loop, the small brackets have 3 arguments, separated by semicolon ; , which are:
    • First argument is initial value of variable V1.
    • Second argument is final value of variable V2.
    • Third argument is the condition applies on this variable i.e. increment, decrement etc.
  • The loop will keep on repeating itself and we will also have the value of iteration in the form of variable value.
  • Let's have a look at its syntax:
for (Initial Value V1; Final Value V2; Condition) { // body of for loop }
  • Now let's have a look at a simple for loop in action
  • Now you can see in above figure that I have initialized an integer variable x and in for loop, I have first assigned the initial value x=0 in first argument.
  • In second argument, separated by ; , I have specified the final value x<10.
  • Finally in third argument, I have incremented the variable x++.
  • So, now when the compiler will first reach for loop, it will get x=0 and will run the code inside { } brackets that's why when I printed the value of x, it was 0 at first.
  • After running all the lines in { } brackets, compiler will run the condition, which is to increment the variable, so in second iteration, the value of x=1, that's why in second line we have 1 on console.
  • So, this loop will keep on running and the variable will keep on incrementing and when it will reach x=9, it will run the code lines in { } brackets and at the end it will increment the variable and will make it x = 10.
  • So, now at x=10, the compiler knows in second argument of For loop, the variable's last value is 9 i.e. x <10. So when the value is not x<10, the compiler will leave for loop and go to next line below for loop.
  • So, that's how For loop works, we can use it for running some lines of code repeatedly and the use of this variable inside for loop is quite helpful.
  • Here's an example, where I have decremented the variable in third argument:
  • From the console, its quite evident that now the variable's value is decreasing from 10 to 1, I have used x - - in condition part of For Loop.
  • Now let's create an array of students' names and display all elements of that array using for Loop, we have discussed How to use Arrays in C# in our 6th lecture, you should recall that as well.
  • Here's the code and it's output on console:
  • As you can see in above figure that first I have initialized a new String Array of size 5.
  • After that added some data i.e. students names, in each element of C# array.
  • Next, I have used for Loop and initialized the variable and also assigned the first value 0 in first argument.
  • In the second argument, I have used a Length property of array and our array's length is 5.
  • So, this for loop will run from 0 to 4 and we can see at the console output that it has printed all the elements of array i.e. students names.
  • That's how, we can use for Loop in C#, now let's have a look at how to use foreach loop in C#, which is kind of an extension of for loop.

How to use Foreach Loop in C#

  • We have discussed Foreach Loop in our 6th tutorial on arrays and I have told you that we will discuss it in detail later, so now is the time to discuss it out.
  • Foreach loop in C# is used to iterate through a collection or arrays from start till end. Collections could be ArrayList, HashTable etc. we will discuss them later.
  • Let's first have a look at its syntax:
foreach (item in collections/arrays) { // body of foreach loop }
  • This item variable will go through the whole array and will repeat the lines of code inside { } brackets.
  • So, let's rewrite our previous example with foreach loop along with for loop and look at both results:
  • Now you can see in above figure that we got similar results for both loops although foreach loop is quite simple and easy to look at thus reduces your code.
  • In foreach loop, we are directly accessing the elements of array, while in for loop, we are getting elements using index of array.
So, that was all about for Loop in C# and we have also had a look at foreach loop. I'm just using simple examples rite now so that you got the clear idea of these loops. We have covered all the loops now so in next tutorial, we will have a look at Methods in C#. Till then take care !!! :)

Benefits of Animated Videos to Grow Your Business

Hello friends, I hope you all are doing great. In today’s tutorial, we will have a look at Benefits of Animated Videos to Grow Your Business. Animated videos are effective tools for audience engagement on your website, social media, at conferences, and employee meetings. Animated videos have the power to increase conversion by 80%. Websites with animation are more likely to attract potential customers. Your competition is using animation to tell stories, enhance their branding, and set themselves apart, in fact, 96% of marketers use animated videos in their marketing campaigns. So let's get started with Benefits of Animated Videos to Grow Your Business.

Why aren’t you?

  • Austin Visuals, a leading US-based animation production company, creates customized motion graphics and other types of 2D and 3D animations to drive maximum sales for businesses of all sizes from start-up to stand out.

Choosing the Right Animation for Your Product

  • Imagination is unlimited, but budgets are not. Austin Visuals, a leading US-based animation production company, creates customized motion graphics and other types of 2D and 3D animations to drive maximum sales for businesses of all sizes from start-up to stand out by helping them choose the right type of animation for their message and budget.

Pre-Created Characters

  • The least expensive form of animation is the pre-created character animation. You start (as always) with a script that explains how to, why to, and when to use your product or service.
  • Austin Visuals then incorporates special effects and pre-created characters to give you a memorable video. Average cost - $1,000 per minute.
Motion Graphics
  • Austin Visuals Animation Company uses illustrations, dancing fonts, After Effects, and more to add zest to live video, drone shots, renders and more to create compelling videos for use on all digital media. Average cost - $1,500 per minute.
Custom 2D
  • Our animation production company will create your unique spokesperson, demonstrate how a motor or engine works, tell a humorous or emotional story, make you a music video for your latest composition, or explain your new product in colorful 2D.
  • Custom 2D is also effective for employee training and communication.
  • Average cost: $2,000-$3,000 per minute.
Custom 3D
  • Austin Visuals Animation Company most frequently uses 3D animation when making complex processes simple.
  • In nearly 12 years, our animation production company has created hundreds of medical/scientific videos for device manufacturers and clinician entrepreneurs to educate a variety of publics.
  • Average cost: $4,000-$6,000 per minute. Consultations are free. Contact Austin Visuals at info@austinvisuals.com to find out how we can help you improve your marketing and sales ROI with animation.
So, friends, it is a detailed tutorial about Benefits of Animated Videos to Grow Your Business if you have any question about it ask in comments.

Preparing for Engineering Certification Exams in the US

Hello friends, I hope you all are doing great. In today’s tutorial, we will have a look at Preparing for Engineering Certification Exams in the US.  Preparing to take an engineering exam can be an intimidating process because you know that it’s going to challenge your ability to recall and use what you’ve learned. Of course, with engineering being such a complex and broad field, involving plenty of math and science, it’s not surprising that high-level engineering exams can be some of the most difficult academic tests you’ll encounter during the course of your education. However, becoming a certified engineer is well worth the hassle when you consider the high salaries and prestigious job positions that come with it. To make sure you’re adequately prepared for your engineering certification exams, we will discuss some tips. So let's get started with Preparing for Engineering Certification Exams in the US.

Preparing for Engineering Certification Exams in the US

 Use Practice Exams
  • If you’re looking for advice about how to prepare for an engineering exam, you’re probably still studying the Fundamentals of Engineering (FE). If that’s the case, you can take several practice exams to see what kind of questions and problems you’ll have to answer and solve on the real exam.
  • That way, when the day of the exam comes, it’ll feel like another walk in the park. Using practice exams is a universally applicable strategy that can be applied to any subject, so be sure to work this into your overall study strategy.
Study the Fundamentals of Engineering
  • As you may know, in order to become a licensed engineer, you must first complete a 4-year college degree program and pass the FE exam. After that, you’ll be working under the guidance of a Professional Engineer (PE) for another 4 years.
  • From there, you’ll need to pass 2 intensive competency tests and apply for licensure with the state’s licensure board.
  • It’s important to have a firm grasp on FE before you go into your first exam, as you’ll need to utilize what you’ve learned under the supervision of a PE.
  • So, instead of just aiming to pass the exam and be done with it, you should go ahead and be prepared to assimilate and retain everything because you’re going to need it all eventually.
Study the Principles and Practices of Engineering
  • The Principles and Practices of Engineering (PE) exam will be the second exam you’ll need to pass while you’re accumulating experience as a supervised apprentice. More than 25,000 interns take the PE exam every year.
  • To give you an idea of how difficult this exam is, the annual pass rate for all students taking the test is below 65%. That means more than a third of engineer interns fail this exam and have to retake it.
  • That’s a remarkably low pass rate when you consider the fact that those are students who have already done extensive studying in the field.
  • The chances of passing such a test without a high level of sustained educational commitment are slim to none.

A Few Tips to Help You Pass the FE and PE Exams

  • Now that you know what you’re up against, and you’ve learned the value of using practice exams during the preparation phase, here are a few tips you can use to maximize your chances of passing any major engineering exam:
Study every day for 3 months
  • Experts recommend giving yourself at least 90 days of preparation at a minimum, with 6 months being an optimal time frame.
Create a study schedule Read PE reference books
  • You can find some incredible PE reference books online.
  • Ultimately, if you heed the tips above and make sure you have a firm grasp of FE and PE, you should be able to pass your exam with flying colors.
So, friends, it is a detailed tutorial about Preparing for Engineering Certification Exams in the US if you have any question about it ask in comments. Thanks for reading.

How to use while Loop in C#

Hello friends, I hope you all are great. Today, I am posting 10th tutorial in C# series and its about How to use while Loop in C#. It's gonna be a quick tutorial, as there's not much to discuss. In our 8th tutorial in C# series, we have had a look at How to use IF Loop in C# and we have seen that IF loop takes a Boolean expression and if it's TRUE then it allows the compiler to enter in it just once. While loop is quite similar to IF loop as it takes a Boolean expression as well but it will keep on executing again & again, so let's have a look at it in detail:

How to use while Loop in C#

  • While Loop in C# takes a Boolean expression as a condition and it will keep on executing as long as the conditional expression returns true, we can say Execute while condition is TRUE.
  • Here's the syntax of while loop:
while (Boolean Expression) { // Code will execute, while Boolean Expression is TRUE }
  • So, let's design a simple example to understand How while Loop works:
  • In schools, you must have studied math tables, so I have created a simple code using while loop which asks from the user to enter table of.
  • When user enters the number, the program will print out its table till 10.
  • If you look at the code, I have used while loop and this while loop will execute 10 times as the condition in while loop is TotalLength <= 10.
  • I have incremented this TotalLength variable in while Loop so when it will become 10, the while loop will stop.
  • So, instead of writing 10 lines to display table, we are just using while loop, we can also increase the lines to 20 or 30 quite easily, that's the benefit of while loop.
  • Let's play with the code a little and print values till 20 and also use IF Loop in this while loop, which we have studied in 8th lecture.
  • You can see in above code that I have increased the length to 20 and then in while Loop, I have used IF Loop.
  • IF the length is 10 then I am just adding blank lines to separate first 10 from last 10.
  • I hope you got the idea of How to use While Loop and what's its difference from IF Loop, the IF Loop executed just once when condition comes true.
  • Here's the complete code used in today's lecture:
using System;

namespace TEPProject
{
    class Program
    {
        static void Main(string[] args)
        {
            
            Console.Write("Enter Table of : ");
            int TableOf = int.Parse(Console.ReadLine());

            int TotalLength = 1;

            while (TotalLength <= 20)
            {
                int TableValue = TotalLength * TableOf;
                Console.WriteLine("{0} x {1} = {2}", TableOf, TotalLength, TableValue);
                if(TotalLength==10)
                {
                    Console.WriteLine("\n");
                }
                TotalLength++;
            }
            Console.WriteLine("\n\n");
            
        }
    }
}
So, that was all about How to use while Loop in C#. In our coming tutorial, we will have a loop at How to use do While Loop in C#. Till then take care !!! :)

How to use switch Statement in C#

Hello friends, I hope you all are doing great. In today's tutorial, we are gonna have a look at How to use switch Statement in C# and its our 9th tutorial in C# series. In our previous tutorial, we have seen IF Loop in C# and this switch statement is also a loop but works slightly different than IF loop and it totally depends on your application, which one you want to use. First we will have a look at How to use switch statement in C# and after that we will also study goto statement, because switch and goto statements are normally used together. So, let's get started with it:

How to use switch Statement in C#

  • Switch Statement is a loop in C# which takes a variable as a condition, and then creates its different cases and we can deal each case separately.
  • We need to use break Statement after every case Statement to get out of the switch Statement.
  • We can also use default Statement at the end of switch Statement, which will execute if none of the cases are true.
  • So let's have a look at the syntax of switch statement in C#:
switch (variable) { case value1: // This case will execute, if variable = value1 break; case value2: // This case will execute, if variable = value2 break; . . . case valueN: // This case will execute, if variable = valueN break; default: // default will execute, if all the above cases are false. break; }
  • As you can see in above syntax, we have first used switch keyword and then took a variable, this variable can have any datatype.
  • Then we have created different cases, we can create as many cases as we want and each case has a value so if the variable is equal to that value then respective case will execute.
  • Let's understand it with an example: Let's design a project where we display information of class students using their roll number, so we will take their roll numbers as an input and will display the respective student's data using switch case statement:
  • As you can see in the above figure that I have first asked for the student's Roll Number and then placed a switch statement and provided RollNo as a conditional variable.
  • After that in each case I have placed the roll no value and for each roll number I have added the name and age of the user.
  • In execution, I have entered 1 and the code has provided me data placed in case 1 and have ignored all the other cases as well as the default case.
  • But if you run this code then you will realize that it asks for the Roll number only once but what if we want it to run again & again.
  • We can use goto Statement for that purpose, although it's not the best way to create loop but one of the ways and you should know about it.
  • In above code, I have just added two lines of code, first I have placed a tag Start: at the top of the code and then at the end I have used goTo Start;
  • So, at the goto Statement, the compiler will find the tag mentioned and will move on to that position and will start executing the code, so it's kind of an infinite loop which is never gonna stop.
  • Here's the final code, which you can test in visual studio:
using System;

namespace TEPProject
{
    class Program
    {
        static void Main(string[] args)
        {
            Start:
            Console.Write("Please enter student's roll number: ");
            int RollNo = int.Parse(Console.ReadLine());
            
            switch(RollNo)
            {
                case 1:
                    Console.WriteLine("Name: StudentA");
                    Console.WriteLine("Age: 18");
                    break;
                case 2:
                    Console.WriteLine("Name: StudentB");
                    Console.WriteLine("Age: 17");
                    break;
                case 3:
                    Console.WriteLine("Name: StudentC");
                    Console.WriteLine("Age: 16");
                    break;
                case 4:
                    Console.WriteLine("Name: StudentD");
                    Console.WriteLine("Age: 20");
                    break;
                case 5:
                    Console.WriteLine("Name: StudentE");
                    Console.WriteLine("Age: 21");
                    break;
                default:
                    Console.WriteLine("No student found.");
                    break;
            }
            Console.WriteLine("\n\n");
            goto Start;
        }
    }
}

So, that was all about How to use switch Statement in C#. If you need any help then ask in comments. Will meet you in next tutorial. Till then take care !!! :)

What is Thyristor

Hello friends, I hope you all are doing great. In today’s tutorial, we will have a look at What is Thyristor. The thyristor is a semiconductor component that has 4 layers of N and P materials with the sequence P, N, P, N. First thyristor was invented in 1950 by William Shockley who was a physicist and belonged to the United States of America. But first time it was practically used in 1956 due to its huge amount of current and voltage handling capability. Due to this feature, it was commonly used in different power control circuitry, fan dimmers, and speed control of different motors. There are 2 types of design in which this module available and both used according to circuit requirements first one has two leads and the second one has three leads in its structure. This electronic component is mostly used in switching circuitry, oscillators, level detection circuits, etc. This module is not similar to the transistor as a transistor can operate among on and off conditions but thyristor operates only single state either on or off. In today's post, we will have a look at its working, structure, pinout, applications and some related parameter. So let's get started with What is Thyristor.

What is Thyristor

  • A thyristor is also known as SCR (silicon controlled rectifiers) used in different switching circuits like a transistor and in power controlling circuitry.
  • The physical structure of this semiconductor is different than the other semiconductors materials like transistor that has three layers but in thyristor 4 layers of different elements are constructed.
  • In a normal transistor, there are 3 P, N, P or N, P, N layer exists but in while in thyristor four-layer like P, N, P, N exists.
  • Its 'P' end is known as anode and 'N' end is known as the cathode. As in normal transistor base control terminal in this device, the control terminal is known as a gate that is adjacent to the cathode.
  •  This module can be created with the different semiconductor materials but normal it is manufactured with the silicon.
  • As the silicone has the ability to handle larger amperes current and voltage easily as well it has ability to bear high temperature so it mostly preferred for thyristor construction.
  • with these features, its price and construction are simple so it prefered for thyristor and some other electronic devices.

 Working of Thyristor

  • The working of this module is different than other semiconductors device, to the understanding of working of this device we draw the equivalent circuit.
  • In the given figure you can see that two transistors are linked with one another the first transistor is NPN that is behaving like the anode and the second transistor is PNP that is behaving like the cathode.
  • If we provide input supply to at the terminals of thyristor there will be no current passes as the both of transistor ane unbiased state.
  • If we connect input supply at the gate then current will passes through the base that will operate the TR2 transistor.
  • When TR2 starts its operation than the base of the first transistor get force from this transistor and start its operation it causes to put TR2 in working state either we separated the input supply.

Features of Thyristor

  • These are some features of thyristor that are described here with detailed.
    Specifications                                         Parameters
    dI/dt Extreme increment of on-state current It is an extreme value of current for on condition if it surpasses then our device will be damaged.
    IGM Maximum Gate Current It is the extreme value at the gate that it can bear.
    IGT Triggering current of the gate It is the triggering value of current at the gate that also starts to current flow through anode and cathode terminals of component.
    I2t Overcurrent protection The I2t parameter tells about the value of fuse used for this module.
    IT(AV) On condition average current This parameter of thyristor explains about the average value of current passing through the module.

Types of Thyristor

  • There are numerous types of thyristor according to their use and structure.
RCT:
  • One important feature of thyristor is that it stops current to flow in reverse direction so if we add and diode then current starts to flow in the opposite direction. This type of arrangement is known as RCT or reverse conducting thyristor.
  • During reverse operation both thyristor and diode not operate at the same time but they take some time for the operation that provides protection from overheating.
  • This type of thyristor used in inverter circuits and frequency regulators.
GATT:
  • This types of thyristor are used in such applications where fast switching needs. For this process in certain cases, negative polarity voltage also provided to the gate.
  • To control the voltage at cathode and anode terminals negative voltage at the gate control the minorities carriers.
  • The physical construction of thyristor is like to normal thyristor but the difference is that the area of cathode that enhances the controlling capability of the gate.
GTO:
  • It is also known switch for a gate of thyristor. This types of thyristor are not normally used in circuits because they not operate at reverse voltage.
Asymmetric Thyristor:
  • In such circuits where there is no use reverse voltage and no need of rectifier circuit this type of thyristor is used. These are normally used in switching circuits.

Applications of Thyristor

  • The thyristor is normally used in different electronic circuits and devices, its some practical uses are explained here with the detailed.
  • It used in different electrical devices for the controlling of alternating current at the input such as motor, light etc.
  • It used in different circuits as a switch.
  • In a different circuit, it used to control the overvoltage.
  • It used in different controllers as a trigger.
  • It also used in camera for flashing of a photograph.
It is the detailed tutorial on thyristor in this post I have mentioned each and everything related to the thyristor. If you still have any question about it ask in comments. Thanks for reading.  

Introduction to LCD 16x2

Hello friends, I hope you all are doing great. In today’s tutorial, we will have a look at Introduction to 16x2 LCD Module. LCD stands for liquid crystal display it is mostly used in different electronic projects and devices to display different values. LCD uses liquid crystals for the generation of visible images. 16 x 2 liquid crystal display is a basic LCD module used in DIY electronic projects and circuits. In this LCD module, there are two rows every row consists of sixteen numbers.

With the two rows in this module, there are sixteen columns. The VA dimensions of these modules are (66 x 16) millimeters and the thickness is 13.2 millimeters. Its operating voltage is plus five or plus three volts. In today's post, we will have a look at working, applications, circuits,  features, advantages and disadvantages. So let's get started with Introduction to 16x2 LCD Module.

Where To Buy?
No.ComponentsDistributorLink To Buy
1LCD 16x2AmazonBuy Now

Introduction to 16x2 LCD Module

  • LCD(liquid crystal display) is normally used in embedded projects due to its low cost, easy access and flexibility to get programmed.
  • Almost every electronic device we daily see like in you mobile, calculator and some other devices.
  • There is a type of liquid display that has sixteen column and two rows so it is known as 16 x 2 LCD modules.
  • LCD also available in different arrangements like (8 x 1), (10 x 2), (16 x 1), but the 16 x 2 liquid crystal is normally used in embedded projects.
  • In this liquid crystal display, there are thirty-two characters and each of them consists of 5 x 8 pixels.
  • So we can say that character consists of forty pixels or dots and total pixels in this liquid crystal display can be fined as (32 x 40) or 1280 pixels.
  • During its interfacing with a microcontroller, it makes sure that liquid crystal display should be directed about the locations of pixels.

Pinout of 16x2 LCD Module

  • These are the main pinouts of 16 x 2 LCD that are described here with the detailed
Pin No: Pin Name:                                         Parameters
Pin#1  Ground This pin is used to connect the ground.
Pin#2  +5 Volt At this pinout plus five volts are applied to on the LCD.
Pin#3 VE This pin used to select the contract of the display.
Pin#4 Register Select This pinout is used to MCU controller connected led to a shift from command to data mode.
Pin#5 Read and Write It used for reading and wiring of data.
Pin#6 Enable It linked with the MCU to toggle among zero and one.
Pin#7 Data Pin 0 The pinouts from zero to seven are data pinouts and these are linked with the MCU for transmission of data. This liquid crystal module can also operate on the four-bit mode by working on o, 1, 2, and 3 pinouts and others are free.  
Pin#8 Data Pin 1
Pin#9 Data Pin 2
Pin#10 Data Pin 3
Pin#11 Data Pin 4
Pin#12 Data Pin 5
Pin#13 Data Pin 6
Pin#14 Data Pin 7
Pin#15 LED Positive This pinout is for turn backlight of led into positive.
Pin#16 LED Negative Backlight liquid crystal display pinout negative terminal.

Command codes for 16x2 LCD Module

  • These are some commands codes for 16 x2 LCD modules.
Sr.No Hex Code                                         Parameters
1  1 This command will remove data displaying on the screen of lcd.
2  2 It used to move back home.
3 4 It used to change location of a cursor to left side.
4 6 It changes the position of cursor to right side.
5 5 It used for shift display on right.
6 7 It used for Shift display one  left
7 8 It used to off the display and cursor will also off.  
8 0A It used for both display off, a cursor on.
9 0C It used for display on, cursor also off.
10 0E By using this command we can on display, the cursor  will be blinking
11 0F By this command Display will be on, the cursor also blinking.
12 10 It changes the location of a cursor to left.
13 14 It set cursor location to right.
14 18 It changes the location of the complete display to the left side.
15 1C It changes the location of the complete display to right side.
16 80 It used to move the cursor to the first line.
17 C0 It send the cursor to starting of the second line.
18 38 2 lines and 5×7 matrix.

Features of 16x2 LCD Module

  • These are some features of 16x2 LCD Module that are described with the detailed.
  • Its functioning voltages are from 4.7 volts to 5.3 volts.
  • It uses one milliampere current for operation.
  • In this liquid crystal display, we can work both alphabets and numbers.
  • On this module, there are rows each has sixteen characters.
  • Every character of this board has 5 x 8 or 40 pixels.
  • It works on both four and eight bits mode.
  • It display screen backlight is two colour green and blue.

Registers of LCD

  • In this module there are 2 main types of register first one is data register and the second one is command register. The RS pinout is used for the change the register.
  • If we set zero then the register is command and at one data register will work.
  • Now we discuss these two registers with the detailed.
Command Register
  • The main function of this register is to save instructions shown on display.
  • That help to a clearing of data changes the location of the cursor and display control.
Data Register
  • This register saves the date to display on the liquid crystal screen. When we send data to liquid crystal display it moves to the data register, processing of that data will initiate.
  • If we set the value of register at one then the data register will start operation.

So it is the detailed article on the 16x2 LCD Module if you have any question about ask in comments. Thanks for reading.

Syed Zain Nasir

I am Syed Zain Nasir, the founder of <a href=https://www.TheEngineeringProjects.com/>The Engineering Projects</a> (TEP). I am a programmer since 2009 before that I just search things, make small projects and now I am sharing my knowledge through this platform.I also work as a freelancer and did many projects related to programming and electrical circuitry. <a href=https://plus.google.com/+SyedZainNasir/>My Google Profile+</a>

Share
Published by
Syed Zain Nasir