SlideShare a Scribd company logo
1 of 19
Download to read offline
Chapter 2Unit: 1 C# language componentsBasics of C# Programming
1
Chapter 2Unit: 1 C# language componentsBasics of C# Programming
2
Table of Contents
1.Design environment... 5
2.Visual Studio 2012 ..........................................................................................6
3.Character constants ...............................................................................................9
Example.......................................................................................................................9
4.Arithmetic Operators 10
Example.....................................................................................................................10
5.Variables 11
6.Code 12
6.Log in 13
7.Code 13
8.Code 16
9.Exercise 17
10.References (APA) 18
Chapter 2Unit: 1 C# language componentsBasics of C# Programming
3
Table of Figure
Figure 1 -1 Visual Studio 2010..........................................................................................5
Figure 1 -2 New project..................................................................................................5
Figure 1 -3 windows from...............................................................................................6
Figure 1 -4 Toolbox........................................................................................................7
Figure 1 -5 properties ....................................................................................................8
Figure 0 -1 APPmVP6 ...................................................................................................12
Figure 0 -1 Log in.........................................................................................................13
Figure 0-1 New window...............................................................................................14
Figure 0 -2 window Name ............................................................................................15
Figure 0 -3 widow C# ..................................................................................................15
Chapter 2Unit: 1 C# language componentsBasics of C# Programming
4
Design environment
Variables
Simple program of C#
Character constants
Arithmetic Operators
Exerciser
Define the Primitive Tool box and properties of visual studio.
list the types of data and how to use
list the types of Tool box and properties and how to use.
Create a micro program of C#.
Analysis the code of C#.
Objective of this chapter student will be able to:
Lesson Content:
Chapter 2Unit: 1 C# language componentsBasics of C# Programming
5
1.Design environment
Start a subscription from Visual Studio 2012 or Visual Studio2010. Go to the File
menu and choose New Project
(Visual Studio2010)
This window will also allow you to change the name of the program and
Figure1-1Visual Studio 2010
Figure 1-2 New project
Chapter 2Unit: 1 C# language componentsBasics of C# Programming
6
the path to save it, and then press OK
2.Visual Studio 2012
Figure 1-3 windows from
Chapter 2Unit: 1 C# language componentsBasics of C# Programming
7
After pressing OK, the following window will appear for the first project
Window (1:)
The tools that include the Clear wares are called the two
programs
Figure 1-4 Toolbox
Chapter 2Unit: 1 C# language componentsBasics of C# Programming
8
Window 2
Which will put in place the tools needed to build the project as well as
possible.
Figure 1-5 properties
Chapter 2Unit: 1 C# language componentsBasics of C# Programming
9
3.Character constants
Character literals are included in single quotes. For example, 'x' can be
stored in a simple variable of char type. A literal character can be a
regular character (such as 'x'), an escape sequence (such as ' t'), or a
generic character (such as ' u02C0'). There are some characters in C #
when preceded by a backslash. They have a special meaning and are
used to represent such as the new font ( n) or the tab ( t). The
following is a list of some of these escape sequence codes:
Escape sequence Meaning
  character
' ' character
" " character
? ? character
a Alert or bell
b Backspace
f Form feed
n Newline
r Carriage return
t Horizontal tab
Table 0-1 Character literals
// private void button1_Click(object sender, EventArgs e)
Chapter 2Unit: 1 C# language componentsBasics of C# Programming
10
4.Arithmetic Operators
Following table shows all the arithmetic operators supported by C#.
Assume variable A holds 10 and variable B holds 20 then:
Operator Description Example
+ Adds two operands A + B = 30
- Subtracts second operand from the first A - B = -10
* Multiplies both operands A * B = 200
/ Divides numerator by de-numerator B / A = 2
% Modulus Operator and remainder of after an integer
division
B % A = 0
++ Increment operator increases integer value by one A++ = 11
-- Decrement operator decreases integer value by one A-- = 9
Table 0-1 Arithmetic Operators
Example
x = int.Parse(textBox1.Text);
y = int.Parse(textBox2.Text);
r = x * y;
textBox3.Text = r.ToString();
Chapter 2Unit: 1 C# language componentsBasics of C# Programming
11
5.Variables
Program (1) A new project was established
File -> New -> Project
1- Button:
Name: button1 Text: ok
2- Button:
Name: button2 Text: Close
1- textBox1:
Name: Name. Text
2- textBox1:
Name: phone. Text
Chapter 2Unit: 1 C# language componentsBasics of C# Programming
12
1- Label1:
For = Name
Name: Name. Text
Text: Name
2- Label2:
For = phone
Text: phone.
6.Code
Double-click on button ok Then write the code inside the button
Double-click on button Close Then write the code inside the button
MessageBox.Show(" Name =" + Name. Text + " phone =" + phone. Text);
Close ();
Figure 0-1 APPmVP6
Chapter 2Unit: 1 C# language componentsBasics of C# Programming
13
6.Log in
1- Button:
Name: button1 Text: ok
2- Button:
Name: button2 Text:
Close
1- textBox1:
Name: User Name
2- textBox1:
Name: password
7.Code
Double-click on button ok Then write the code inside the button
Figure 0-1 Log in
if (textBox1.Text == "123" && textBox2.Text == "123")
{
window sig = new window();
sig.Show();
}
else
{
MessageBox.Show("Please Check your username or password");
Chapter 2Unit: 1 C# language componentsBasics of C# Programming
14
Double-click on button Close Then write the code inside the button
Figure 0-1 New window
New window was created
windows forma Application > ADD> window form
Close ();
Chapter 2Unit: 1 C# language componentsBasics of C# Programming
15
Window Name > ADD
*You can add any name
1- linkLabel1:
Name: C#
Link:
http://www.ttcollege.edu.sa/
-2 pictureBox1
Figure0-2 window Name
Figure 0-3 widow C#
Chapter 2Unit: 1 C# language componentsBasics of C# Programming
16
8.Code
Double-click on linkLabel1 Then write the code inside the linkLabel1
System.Diagnostics.Process.Start("http://www.ttcollege.edu.sa/");
Chapter 2Unit: 1 C# language componentsBasics of C# Programming
17
9.Exercise
1- Create a new project in visual studio and demonstrate the use of menu strips, menu bars,
context menus, and status bar.
………………………………………………………………………………………………………………
………………………………………………………………………………………………………………
2- Create a new project in visual studio and demonstrate the program
that collects two numbers.
………………………………………………………………………………………………………………
………………………………………………………………………………………………………………
Chapter 2Unit: 1 C# language componentsBasics of C# Programming
18
10.References (APA)
Hejlsberg, A., Torgersen, M., Wiltamuth, S., & Golde, P. (2010). C# Programming language.
Addison-Wesley Professional.
Obasanjo, D. (2002). A comparison of Microsoft’s C# programming language to Sun
Microsystem’s Java programming language.
Marshall, D. (2005). Programming Microsoft Visual C# 2005 Core Reference. Microsoft Press.

More Related Content

What's hot

Computer science class 12 project on Super Market Billing
Computer science class 12 project on Super Market BillingComputer science class 12 project on Super Market Billing
Computer science class 12 project on Super Market BillingHarsh Kumar
 
C# Tutorial MSM_Murach chapter-23-slides
C# Tutorial MSM_Murach chapter-23-slidesC# Tutorial MSM_Murach chapter-23-slides
C# Tutorial MSM_Murach chapter-23-slidesSami Mut
 
C# Tutorial MSM_Murach chapter-24-slides
C# Tutorial MSM_Murach chapter-24-slidesC# Tutorial MSM_Murach chapter-24-slides
C# Tutorial MSM_Murach chapter-24-slidesSami Mut
 
FINAL PAPER FP301 OBJECT ORIENTED PROGRAMMING
FINAL PAPER FP301 OBJECT ORIENTED PROGRAMMINGFINAL PAPER FP301 OBJECT ORIENTED PROGRAMMING
FINAL PAPER FP301 OBJECT ORIENTED PROGRAMMINGAmira Dolce Farhana
 
C# Tutorial MSM_Murach chapter-05-slides
C# Tutorial MSM_Murach chapter-05-slidesC# Tutorial MSM_Murach chapter-05-slides
C# Tutorial MSM_Murach chapter-05-slidesSami Mut
 
C# Tutorial MSM_Murach chapter-12-slides
C# Tutorial MSM_Murach chapter-12-slidesC# Tutorial MSM_Murach chapter-12-slides
C# Tutorial MSM_Murach chapter-12-slidesSami Mut
 
C# Tutorial MSM_Murach chapter-09-slides
C# Tutorial MSM_Murach chapter-09-slidesC# Tutorial MSM_Murach chapter-09-slides
C# Tutorial MSM_Murach chapter-09-slidesSami Mut
 
C# Tutorial MSM_Murach chapter-07-slides
C# Tutorial MSM_Murach chapter-07-slidesC# Tutorial MSM_Murach chapter-07-slides
C# Tutorial MSM_Murach chapter-07-slidesSami Mut
 
C# Tutorial MSM_Murach chapter-25-slides
C# Tutorial MSM_Murach chapter-25-slidesC# Tutorial MSM_Murach chapter-25-slides
C# Tutorial MSM_Murach chapter-25-slidesSami Mut
 
C# Tutorial MSM_Murach chapter-20-slides
C# Tutorial MSM_Murach chapter-20-slidesC# Tutorial MSM_Murach chapter-20-slides
C# Tutorial MSM_Murach chapter-20-slidesSami Mut
 
C# Tutorial MSM_Murach chapter-03-slides
C# Tutorial MSM_Murach chapter-03-slidesC# Tutorial MSM_Murach chapter-03-slides
C# Tutorial MSM_Murach chapter-03-slidesSami Mut
 
C# Tutorial MSM_Murach chapter-08-slides
C# Tutorial MSM_Murach chapter-08-slidesC# Tutorial MSM_Murach chapter-08-slides
C# Tutorial MSM_Murach chapter-08-slidesSami Mut
 
Informatics practises 12th CBSE INDIA 2012-2013 MAIN EXAM paper
Informatics practises 12th CBSE INDIA 2012-2013 MAIN EXAM paperInformatics practises 12th CBSE INDIA 2012-2013 MAIN EXAM paper
Informatics practises 12th CBSE INDIA 2012-2013 MAIN EXAM paperHarish Gyanani
 
C# Tutorial MSM_Murach chapter-06-slides
C# Tutorial MSM_Murach chapter-06-slidesC# Tutorial MSM_Murach chapter-06-slides
C# Tutorial MSM_Murach chapter-06-slidesSami Mut
 
FP 301 OOP FINAL PAPER JUNE 2013
FP 301 OOP FINAL PAPER JUNE 2013FP 301 OOP FINAL PAPER JUNE 2013
FP 301 OOP FINAL PAPER JUNE 2013Syahriha Ruslan
 
C# Tutorial MSM_Murach chapter-04-slides
C# Tutorial MSM_Murach chapter-04-slidesC# Tutorial MSM_Murach chapter-04-slides
C# Tutorial MSM_Murach chapter-04-slidesSami Mut
 

What's hot (20)

Computer science class 12 project on Super Market Billing
Computer science class 12 project on Super Market BillingComputer science class 12 project on Super Market Billing
Computer science class 12 project on Super Market Billing
 
C# Tutorial MSM_Murach chapter-23-slides
C# Tutorial MSM_Murach chapter-23-slidesC# Tutorial MSM_Murach chapter-23-slides
C# Tutorial MSM_Murach chapter-23-slides
 
C# Tutorial MSM_Murach chapter-24-slides
C# Tutorial MSM_Murach chapter-24-slidesC# Tutorial MSM_Murach chapter-24-slides
C# Tutorial MSM_Murach chapter-24-slides
 
Oops Quiz
Oops QuizOops Quiz
Oops Quiz
 
FINAL PAPER FP301 OBJECT ORIENTED PROGRAMMING
FINAL PAPER FP301 OBJECT ORIENTED PROGRAMMINGFINAL PAPER FP301 OBJECT ORIENTED PROGRAMMING
FINAL PAPER FP301 OBJECT ORIENTED PROGRAMMING
 
C# Tutorial MSM_Murach chapter-05-slides
C# Tutorial MSM_Murach chapter-05-slidesC# Tutorial MSM_Murach chapter-05-slides
C# Tutorial MSM_Murach chapter-05-slides
 
C# Tutorial MSM_Murach chapter-12-slides
C# Tutorial MSM_Murach chapter-12-slidesC# Tutorial MSM_Murach chapter-12-slides
C# Tutorial MSM_Murach chapter-12-slides
 
C# Tutorial MSM_Murach chapter-09-slides
C# Tutorial MSM_Murach chapter-09-slidesC# Tutorial MSM_Murach chapter-09-slides
C# Tutorial MSM_Murach chapter-09-slides
 
C# Tutorial MSM_Murach chapter-07-slides
C# Tutorial MSM_Murach chapter-07-slidesC# Tutorial MSM_Murach chapter-07-slides
C# Tutorial MSM_Murach chapter-07-slides
 
C# Tutorial MSM_Murach chapter-25-slides
C# Tutorial MSM_Murach chapter-25-slidesC# Tutorial MSM_Murach chapter-25-slides
C# Tutorial MSM_Murach chapter-25-slides
 
Intake 38 8
Intake 38 8Intake 38 8
Intake 38 8
 
C# Tutorial MSM_Murach chapter-20-slides
C# Tutorial MSM_Murach chapter-20-slidesC# Tutorial MSM_Murach chapter-20-slides
C# Tutorial MSM_Murach chapter-20-slides
 
C# Tutorial MSM_Murach chapter-03-slides
C# Tutorial MSM_Murach chapter-03-slidesC# Tutorial MSM_Murach chapter-03-slides
C# Tutorial MSM_Murach chapter-03-slides
 
C# Tutorial MSM_Murach chapter-08-slides
C# Tutorial MSM_Murach chapter-08-slidesC# Tutorial MSM_Murach chapter-08-slides
C# Tutorial MSM_Murach chapter-08-slides
 
2621008 - C++ 1
2621008 -  C++ 12621008 -  C++ 1
2621008 - C++ 1
 
Informatics practises 12th CBSE INDIA 2012-2013 MAIN EXAM paper
Informatics practises 12th CBSE INDIA 2012-2013 MAIN EXAM paperInformatics practises 12th CBSE INDIA 2012-2013 MAIN EXAM paper
Informatics practises 12th CBSE INDIA 2012-2013 MAIN EXAM paper
 
C# Tutorial MSM_Murach chapter-06-slides
C# Tutorial MSM_Murach chapter-06-slidesC# Tutorial MSM_Murach chapter-06-slides
C# Tutorial MSM_Murach chapter-06-slides
 
FP 301 OOP FINAL PAPER JUNE 2013
FP 301 OOP FINAL PAPER JUNE 2013FP 301 OOP FINAL PAPER JUNE 2013
FP 301 OOP FINAL PAPER JUNE 2013
 
Lecture 1
Lecture 1Lecture 1
Lecture 1
 
C# Tutorial MSM_Murach chapter-04-slides
C# Tutorial MSM_Murach chapter-04-slidesC# Tutorial MSM_Murach chapter-04-slides
C# Tutorial MSM_Murach chapter-04-slides
 

Similar to Content

Vbtutorial
VbtutorialVbtutorial
Vbtutorialdhi her
 
Experiment_1.pdf
Experiment_1.pdfExperiment_1.pdf
Experiment_1.pdfmusa572502
 
Vb tutorial
Vb tutorialVb tutorial
Vb tutorialjayguyab
 
PT1420 File Access and Visual Basic .docx
PT1420 File Access and Visual Basic                      .docxPT1420 File Access and Visual Basic                      .docx
PT1420 File Access and Visual Basic .docxamrit47
 
CODING-DAY-2-INTRODUCTION TO C PROGRAMMING.ppt
CODING-DAY-2-INTRODUCTION TO C PROGRAMMING.pptCODING-DAY-2-INTRODUCTION TO C PROGRAMMING.ppt
CODING-DAY-2-INTRODUCTION TO C PROGRAMMING.pptadamjackson818417
 
Programming with c language practical manual
Programming with c language practical manualProgramming with c language practical manual
Programming with c language practical manualAnil Bishnoi
 
C programming languag for cse students
C programming languag for cse studentsC programming languag for cse students
C programming languag for cse studentsAbdur Rahim
 
Software engineering modeling lab lectures
Software engineering modeling lab lecturesSoftware engineering modeling lab lectures
Software engineering modeling lab lecturesmarwaeng
 
Ch2 introduction to c
Ch2 introduction to cCh2 introduction to c
Ch2 introduction to cHattori Sidek
 
C++ Overview
C++ OverviewC++ Overview
C++ Overviewkelleyc3
 
2.Overview of C language.pptx
2.Overview of C language.pptx2.Overview of C language.pptx
2.Overview of C language.pptxVishwas459764
 
Mid term sem 2 1415 sol
Mid term sem 2 1415 solMid term sem 2 1415 sol
Mid term sem 2 1415 solIIUM
 
C programming session 01
C programming session 01C programming session 01
C programming session 01Vivek Singh
 
cpp-streams.ppt,C++ is the top choice of many programmers for creating powerf...
cpp-streams.ppt,C++ is the top choice of many programmers for creating powerf...cpp-streams.ppt,C++ is the top choice of many programmers for creating powerf...
cpp-streams.ppt,C++ is the top choice of many programmers for creating powerf...bhargavi804095
 
Adapted from Harris & Harris Digital Design and Computer Arch.docx
Adapted from Harris & Harris Digital Design and Computer Arch.docxAdapted from Harris & Harris Digital Design and Computer Arch.docx
Adapted from Harris & Harris Digital Design and Computer Arch.docxnettletondevon
 

Similar to Content (20)

Vbtutorial
VbtutorialVbtutorial
Vbtutorial
 
Experiment_1.pdf
Experiment_1.pdfExperiment_1.pdf
Experiment_1.pdf
 
Vb tutorial
Vb tutorialVb tutorial
Vb tutorial
 
Vb tutorial
Vb tutorialVb tutorial
Vb tutorial
 
PT1420 File Access and Visual Basic .docx
PT1420 File Access and Visual Basic                      .docxPT1420 File Access and Visual Basic                      .docx
PT1420 File Access and Visual Basic .docx
 
CODING-DAY-2-INTRODUCTION TO C PROGRAMMING.ppt
CODING-DAY-2-INTRODUCTION TO C PROGRAMMING.pptCODING-DAY-2-INTRODUCTION TO C PROGRAMMING.ppt
CODING-DAY-2-INTRODUCTION TO C PROGRAMMING.ppt
 
Programming with c language practical manual
Programming with c language practical manualProgramming with c language practical manual
Programming with c language practical manual
 
C programming languag for cse students
C programming languag for cse studentsC programming languag for cse students
C programming languag for cse students
 
Software engineering modeling lab lectures
Software engineering modeling lab lecturesSoftware engineering modeling lab lectures
Software engineering modeling lab lectures
 
Ch2 introduction to c
Ch2 introduction to cCh2 introduction to c
Ch2 introduction to c
 
C++ Overview
C++ OverviewC++ Overview
C++ Overview
 
2.Overview of C language.pptx
2.Overview of C language.pptx2.Overview of C language.pptx
2.Overview of C language.pptx
 
Mid term sem 2 1415 sol
Mid term sem 2 1415 solMid term sem 2 1415 sol
Mid term sem 2 1415 sol
 
C programming session 01
C programming session 01C programming session 01
C programming session 01
 
Vb6.0 intro
Vb6.0 introVb6.0 intro
Vb6.0 intro
 
cpp-streams.ppt,C++ is the top choice of many programmers for creating powerf...
cpp-streams.ppt,C++ is the top choice of many programmers for creating powerf...cpp-streams.ppt,C++ is the top choice of many programmers for creating powerf...
cpp-streams.ppt,C++ is the top choice of many programmers for creating powerf...
 
Intro cpp
Intro cppIntro cpp
Intro cpp
 
Adapted from Harris & Harris Digital Design and Computer Arch.docx
Adapted from Harris & Harris Digital Design and Computer Arch.docxAdapted from Harris & Harris Digital Design and Computer Arch.docx
Adapted from Harris & Harris Digital Design and Computer Arch.docx
 
Chapter03_PPT.ppt
Chapter03_PPT.pptChapter03_PPT.ppt
Chapter03_PPT.ppt
 
OVERVIEW OF ‘C’ PROGRAM
OVERVIEW OF ‘C’ PROGRAMOVERVIEW OF ‘C’ PROGRAM
OVERVIEW OF ‘C’ PROGRAM
 

More from o3aroo

Robert mills gani
Robert mills ganiRobert mills gani
Robert mills ganio3aroo
 
Unit 4
Unit 4  Unit 4
Unit 4 o3aroo
 
Survey results
Survey resultsSurvey results
Survey resultso3aroo
 
Classroom management (1)
Classroom management  (1)Classroom management  (1)
Classroom management (1)o3aroo
 
Differentiation
DifferentiationDifferentiation
Differentiationo3aroo
 
C# programming language
C# programming languageC# programming language
C# programming languageo3aroo
 

More from o3aroo (6)

Robert mills gani
Robert mills ganiRobert mills gani
Robert mills gani
 
Unit 4
Unit 4  Unit 4
Unit 4
 
Survey results
Survey resultsSurvey results
Survey results
 
Classroom management (1)
Classroom management  (1)Classroom management  (1)
Classroom management (1)
 
Differentiation
DifferentiationDifferentiation
Differentiation
 
C# programming language
C# programming languageC# programming language
C# programming language
 

Recently uploaded

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 

Recently uploaded (20)

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 

Content

  • 1.
  • 2. Chapter 2Unit: 1 C# language componentsBasics of C# Programming 1
  • 3. Chapter 2Unit: 1 C# language componentsBasics of C# Programming 2 Table of Contents 1.Design environment... 5 2.Visual Studio 2012 ..........................................................................................6 3.Character constants ...............................................................................................9 Example.......................................................................................................................9 4.Arithmetic Operators 10 Example.....................................................................................................................10 5.Variables 11 6.Code 12 6.Log in 13 7.Code 13 8.Code 16 9.Exercise 17 10.References (APA) 18
  • 4. Chapter 2Unit: 1 C# language componentsBasics of C# Programming 3 Table of Figure Figure 1 -1 Visual Studio 2010..........................................................................................5 Figure 1 -2 New project..................................................................................................5 Figure 1 -3 windows from...............................................................................................6 Figure 1 -4 Toolbox........................................................................................................7 Figure 1 -5 properties ....................................................................................................8 Figure 0 -1 APPmVP6 ...................................................................................................12 Figure 0 -1 Log in.........................................................................................................13 Figure 0-1 New window...............................................................................................14 Figure 0 -2 window Name ............................................................................................15 Figure 0 -3 widow C# ..................................................................................................15
  • 5. Chapter 2Unit: 1 C# language componentsBasics of C# Programming 4 Design environment Variables Simple program of C# Character constants Arithmetic Operators Exerciser Define the Primitive Tool box and properties of visual studio. list the types of data and how to use list the types of Tool box and properties and how to use. Create a micro program of C#. Analysis the code of C#. Objective of this chapter student will be able to: Lesson Content:
  • 6. Chapter 2Unit: 1 C# language componentsBasics of C# Programming 5 1.Design environment Start a subscription from Visual Studio 2012 or Visual Studio2010. Go to the File menu and choose New Project (Visual Studio2010) This window will also allow you to change the name of the program and Figure1-1Visual Studio 2010 Figure 1-2 New project
  • 7. Chapter 2Unit: 1 C# language componentsBasics of C# Programming 6 the path to save it, and then press OK 2.Visual Studio 2012 Figure 1-3 windows from
  • 8. Chapter 2Unit: 1 C# language componentsBasics of C# Programming 7 After pressing OK, the following window will appear for the first project Window (1:) The tools that include the Clear wares are called the two programs Figure 1-4 Toolbox
  • 9. Chapter 2Unit: 1 C# language componentsBasics of C# Programming 8 Window 2 Which will put in place the tools needed to build the project as well as possible. Figure 1-5 properties
  • 10. Chapter 2Unit: 1 C# language componentsBasics of C# Programming 9 3.Character constants Character literals are included in single quotes. For example, 'x' can be stored in a simple variable of char type. A literal character can be a regular character (such as 'x'), an escape sequence (such as ' t'), or a generic character (such as ' u02C0'). There are some characters in C # when preceded by a backslash. They have a special meaning and are used to represent such as the new font ( n) or the tab ( t). The following is a list of some of these escape sequence codes: Escape sequence Meaning character ' ' character " " character ? ? character a Alert or bell b Backspace f Form feed n Newline r Carriage return t Horizontal tab Table 0-1 Character literals // private void button1_Click(object sender, EventArgs e)
  • 11. Chapter 2Unit: 1 C# language componentsBasics of C# Programming 10 4.Arithmetic Operators Following table shows all the arithmetic operators supported by C#. Assume variable A holds 10 and variable B holds 20 then: Operator Description Example + Adds two operands A + B = 30 - Subtracts second operand from the first A - B = -10 * Multiplies both operands A * B = 200 / Divides numerator by de-numerator B / A = 2 % Modulus Operator and remainder of after an integer division B % A = 0 ++ Increment operator increases integer value by one A++ = 11 -- Decrement operator decreases integer value by one A-- = 9 Table 0-1 Arithmetic Operators Example x = int.Parse(textBox1.Text); y = int.Parse(textBox2.Text); r = x * y; textBox3.Text = r.ToString();
  • 12. Chapter 2Unit: 1 C# language componentsBasics of C# Programming 11 5.Variables Program (1) A new project was established File -> New -> Project 1- Button: Name: button1 Text: ok 2- Button: Name: button2 Text: Close 1- textBox1: Name: Name. Text 2- textBox1: Name: phone. Text
  • 13. Chapter 2Unit: 1 C# language componentsBasics of C# Programming 12 1- Label1: For = Name Name: Name. Text Text: Name 2- Label2: For = phone Text: phone. 6.Code Double-click on button ok Then write the code inside the button Double-click on button Close Then write the code inside the button MessageBox.Show(" Name =" + Name. Text + " phone =" + phone. Text); Close (); Figure 0-1 APPmVP6
  • 14. Chapter 2Unit: 1 C# language componentsBasics of C# Programming 13 6.Log in 1- Button: Name: button1 Text: ok 2- Button: Name: button2 Text: Close 1- textBox1: Name: User Name 2- textBox1: Name: password 7.Code Double-click on button ok Then write the code inside the button Figure 0-1 Log in if (textBox1.Text == "123" && textBox2.Text == "123") { window sig = new window(); sig.Show(); } else { MessageBox.Show("Please Check your username or password");
  • 15. Chapter 2Unit: 1 C# language componentsBasics of C# Programming 14 Double-click on button Close Then write the code inside the button Figure 0-1 New window New window was created windows forma Application > ADD> window form Close ();
  • 16. Chapter 2Unit: 1 C# language componentsBasics of C# Programming 15 Window Name > ADD *You can add any name 1- linkLabel1: Name: C# Link: http://www.ttcollege.edu.sa/ -2 pictureBox1 Figure0-2 window Name Figure 0-3 widow C#
  • 17. Chapter 2Unit: 1 C# language componentsBasics of C# Programming 16 8.Code Double-click on linkLabel1 Then write the code inside the linkLabel1 System.Diagnostics.Process.Start("http://www.ttcollege.edu.sa/");
  • 18. Chapter 2Unit: 1 C# language componentsBasics of C# Programming 17 9.Exercise 1- Create a new project in visual studio and demonstrate the use of menu strips, menu bars, context menus, and status bar. ……………………………………………………………………………………………………………… ……………………………………………………………………………………………………………… 2- Create a new project in visual studio and demonstrate the program that collects two numbers. ……………………………………………………………………………………………………………… ………………………………………………………………………………………………………………
  • 19. Chapter 2Unit: 1 C# language componentsBasics of C# Programming 18 10.References (APA) Hejlsberg, A., Torgersen, M., Wiltamuth, S., & Golde, P. (2010). C# Programming language. Addison-Wesley Professional. Obasanjo, D. (2002). A comparison of Microsoft’s C# programming language to Sun Microsystem’s Java programming language. Marshall, D. (2005). Programming Microsoft Visual C# 2005 Core Reference. Microsoft Press.