C#LANGUAGE
COURSE INFORMATION
• COURSE: APPILED PROGRAMMING IN ENGINEERING
• PROGRAMMING LANGUAGE: C#
• SOFTWARE: Visual Studio 2022
• TEXTBOOKS:
⚬
⚬
• LECTURE SLIDES, PROGRAMING ASSIGNMENT: [Link]
ASSIGNMENT & GRADING
• ASSIGNMENT & EXAMINATION:
⚬ Midterm :
⚬
⚬
⚬ Final Examination:
⚬
1.1 GUI PROGRAMMING
•
•
• process of designing and
developing software applications that allow users
to interact with the system through graphical
elements rather than text-based commands.
1.1 GUI PROGRAMMING
•
•
• the process of
managing and responding to events triggered by
user actions.
1.2 C# PROGRAMMING LANGUAGE
•
•
1.2 C# PROGRAMMING LANGUAGE
• Language Paradigm:
• C#
• Memory Management:
• C
• Platform Dependence:
•
• Debugging and Error Handling:
•
1.2 C# PROGRAMMING LANGUAGE
• .NET Framework: Framework and Integrated Development Environment (IDE):
•
•
• Common Language Runtime (CLR):
•
•
1.2 C# PROGRAMMING LANGUAGE
• Windows form?
• WinForms (Windows Forms): is a GUI (Graphical User
Interface) application framework in C# that allows developers
to create desktop applications for Windows operating
systems.
• It provides a set of controls and tools to design and build
desktop applications with graphical user interfaces, such as
buttons, textboxes, labels, and more, all within a form (a
window or dialog box).
1.3 VISUAL STUDIO 2022
•
1.3 VISUAL STUDIO 2022
• Step 1
• Step 2:
vs_community.exe
1.3 VISUAL STUDIO 2022
• Step 3
• Step 4:
• Step 5:
• Step 6: Start installing
1.3 VISUAL STUDIO 2022
• Solution:
o
• Project:
o
o
1.3 VISUAL STUDIO 2022
• VISUAL STUDIO 2022 TOOL WINDOWS:
• Solution Explorer:
• Properties Window:
• Error List:
• Output Window:
• Code Editor:
• Toolbox:
1.3 VISUAL STUDIO 2022
•
• The main interface where developers write, edit, and
manage their source code.
•
•
•
1.3 VISUAL STUDIO 2022
• Code Snippets:
o
o
Edit > IntelliSense > Insert Snippet
• Insert snippet:
o
o Tab
1.3 VISUAL STUDIO 2022
•
• IntelliSense
o List Members
o Parameter Info
o Quick Info:
o Complete Word:
1.4 C# PROGRAM IN VISUAL STUDIO
Create project in Visual Studio:
• Step 1 Create a
new project
• Step 2: C# Windows
Console
• Step 3: Project
name
1.4 C# PROGRAM IN VISUAL STUDIO
structure of a C# program
• Using Directives: using System;
• Namespace Declarations:
• Class Declaration:
• Main Method:
• Program Statements (or Program Logic):
1.4 C# PROGRAM IN VISUAL STUDIO
• using:
• using
• using
1.4 C# PROGRAM IN VISUAL STUDIO
• namespace:
•
•
1.4 C# PROGRAM IN VISUAL STUDIO
• class Program:
•
• The class Program
• Main method
• The class Program Main method
1.4 C# PROGRAM IN VISUAL STUDIO
• Main method:
• Main method
• Main method
static class-level method
• string[] args:
• Main method
1.4 C# PROGRAM IN VISUAL STUDIO
• C# CODING STANDARDS:
• Class Method names Pascal Case
• Method Local variables Camel Case
Employee
GetBonus()
PrintDetails employeeId firstName
totalSalary
1.4 C# PROGRAM IN VISUAL STUDIO
• underscore
// Correct
fromDate
firstName
// Avoid
from_Date
first_Name
1.4 C# PROGRAM IN VISUAL STUDIO
// Correct
employeeId;
employeeName;
isActive;
// Avoid
employeeId;
employeeName;
isActive;
1.4 C# PROGRAM IN VISUAL STUDIO
•
// Correct
IEmployee
IShape
// Avoid
Employee
Shape
1.4 C# PROGRAM IN VISUAL STUDIO
•
// Correct
Employee
PrintDetails()
// Avoid
Employee
PrintDetails()
1.4 C# PROGRAM IN VISUAL STUDIO
// Correct
firstName
firstName
// Avoid
firstName
firstName
1.4 C# PROGRAM IN VISUAL STUDIO
// Correct
MIN_AGE
MAX_AGE
// Avoid
Min_Age
Max_Age
THANK YOU