"Verified" ~ "verified*" ~ "verified^" Study Cube Learning: May 2020

Tuesday, May 26, 2020

C# statements

C# statements are an executable part of the program it will perform some action. There are multiple types of statements.

  •  Expression Statements.
  •  Compound Statements.
  •  Selection Statements.
  •  Iterative Statements.
  •  Jump Statements.

Expression Statements: 

An expression followed by a semicolon is called an expression statement.

Example:-

40 > 50;

d = 10 + 20 * 30;

M = N + 10 ;

x ? y : z ;

Compound Statement :

It is a combination of several expression statements. Compound Statement are grouped together in braces{}.

We can also call as Block Statement.

Example:-

{

int num1 =10, num2=20, sum;

sum = num1+ num2;

Console.WriteLine (sum);

Console.ReadLine();

}

 Selection Statements :

Selection Statements are used for decisions making purposes. Some examples of Selection statements. We will discuss briefly in the upcoming session.

  • if
  • if…else
  • switch

 Iterative Statements :

If we need to perform a part of program many times then we will use loops. It is also called Loops. We will discuss briefly in the upcoming session.

  • for loop.
  • while loop.
  • do-while loop.

Jump Statements :

Jump statements are used to transfer control from one location to another location in the program. We will discuss briefly in the upcoming session. 

  • goto.
  • continue.
  • break.
  • return.
  • throw

 


Thursday, May 21, 2020

C# Tutorial 3 - C# Variable | Variable Initialization | C# Data Type

Variable - 

A variable is a name that denotes a storage area used to store a data value that can be changed by our program.
 
Variable declaration rules -

1- They must not start with a digit.
2- Uppercase and lowercase are treated as unique.
3- We can not declare the keyword as a variable.
4- We can not use white space.
5- Variable names can be of any length.

Initialization of variables -

string stringVar = "Hello World!!";
int intVar = 100;
float floatVar = 10.2f;
char charVar = 'A';
bool boolVar = true;  


It specifies the size and type of values that can be stored in variable. There are 2 types of data type.



















































C# Tutorial 2 - Comments in C#

Comment in C# is basically used for explaining programs and lines of code do. Comments are ignored by the compiler. There are three types of comments.

1- Single line comment - It is used for commenting the single line of code.
      // Single line Comment
 
2- Multi-line comment - It is used for commenting the multiple lines of code. 
      /* Multiple 
      line of code comment */

C# Program to explain the single line and multiline comments -

class Hello {    
    // Single Line Comment -- Function to print Message 
    public static void PrintMessage(string message) 
    { 
        Console.WriteLine (message); 
    }       
    // Main function 
    static void Main(string[] args) 
    {           
        /* Multiline Comment -- 
           Define a variable of 
           string type and assign 
           value to it*/
        string msg = "Study Cube Learning";           
        PrintMessage (msg);           // Calling function 
    } 

3- XML Comment - It is used for commenting the multiple lines of code for better understanding the program does.

class Hello {    
/// <summary>
/// Method to show string message
///</summary>
///<pram name =“message”></param>
    public static void PrintMessage (string message) 
    { 
        Console.WriteLine (message); 
    }           
    static void Main(string[] args) 
    {           
        string msg = "Study Cube Learning";           
        PrintMessage (msg); 
    } 



C# Tutorial 1 - Introduction | First C# Program | C# Tutorial for Beginners

C#-

C# is an object-oriented programming language developed by Microsoft Corporation.
It was developed by Anders Hejlsberg and his team during the development of .Net Framework.

The below reasons make C# a widely used professional language −
  • It is a modern programming language.
  • It can be compiled on a different different of computer platforms. 
  • It is a general-purpose programming language
  • It is an object-oriented programming language.
  • Very easy to learn.
  • It is a structured language.
Characteristics of C#-
  • Simple
  • Consistent
  • Modern
  • Object-oriented
  • Type safe
  • Compatible
Microsoft provides the below development tools for C# programming −
Visual Studio 2010, 2012, 2013, 2015, 2017, 2019 etc.

First C# Program example-

using System;
class Demo
{
    public static void Main()
    {
        Console.WriteLine("Hello world");
        Console.ReadLine();
    }
}


Choose the Right Graphic Designer

 Picking a decent visual originator is critical in the improvement of your image. There are many visual originators around and everybody you...