Содержание
- 2. Your First C# Program Our first C# program is a real classic. It does nothing more
- 3. This program sends the simple greeting to the console // Example1_1.cs // This program sends a
- 4. A Closer Look to the strucure of C# program In C#, as in other C-style languages,
- 5. Variables in C# We declare variables in C# using the following syntax: DataType variableName; // or
- 6. Initialization of Variables Can’t do this ! Need to initialize d befor use Would only create
- 7. Variable scope
- 8. Scope clashes for local variables public static i n t Main(){ int j = 20; We
- 9. Scope clashes for fields and local variables class ScopeTest2 { static int j = 20; public
- 10. Constants const int a = 10 0 ; // This value cannot be chang e They
- 11. Statements Programs consist of sequences of C# statements Conditional statements Loops Statements allow us to control
- 12. Conditional statements The if statement One - way if if ([condition]) [code to execute] if ([condition])
- 13. The switch statement switch ([expression to check]) { case [test1]: ... [exit case statement] case [test2]:
- 14. Loops C# provides four different loops The for loop The do … while loop Loops allow
- 15. The for loop Syntax for (int i = 0; i { // Code to loop, which
- 16. Nested loops Example static void Main(string[] args) { // This loop iterates through rows... for (int
- 17. The while loop while ([condition]) { [Code to loop] } Syntax double balance = 100D; double
- 18. The do … while loop The do...while loop is the post-test version of the while loop
- 19. The foreach loop The foreach loop allows us to iterate through each item in a collection.
- 20. Jump statements C# provides the number of statements that allow us to jump to another line
- 21. Classes and Structs Classes and structs are templates form wich we can create objects. Each object
- 22. Classes Members Data members are those members that contain the data for the class – fields,
- 23. Classes Members Fields are any variables associated with the class. We can access these fields using
- 24. Function Members Function members are those members that provide some functionality for manipulating the data in
- 25. Declaring methods The definition of the method consists: method modifiers, the type of return value, the
- 26. Passing parameters to methods class ParameterTest{ s ta t ic void SomeFunction(int[] ints , int i)
- 27. Ref parameters // define method stati c v oid SomeFunction(int[] ints, re f int i) {
- 28. Out parameters // define method stati c v oid SomeFunction(out int i) { i = 100;
- 29. Properties The idea of a property is that it is a method or pair of methods
- 30. To define a property… We use the following syntax: The get accessor takes no parameters and
- 31. To define a property… private string foreNam e; p ublic string ForeName{ get { r eturn
- 33. Скачать презентацию










![Conditional statements The if statement One - way if if ([condition]) [code](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/382500/slide-11.jpg)
![The switch statement switch ([expression to check]) { case [test1]: ... [exit](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/382500/slide-12.jpg)


![Nested loops Example static void Main(string[] args) { // This loop iterates](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/382500/slide-15.jpg)
![The while loop while ([condition]) { [Code to loop] } Syntax double](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/382500/slide-16.jpg)








![Passing parameters to methods class ParameterTest{ s ta t ic void SomeFunction(int[]](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/382500/slide-25.jpg)
![Ref parameters // define method stati c v oid SomeFunction(int[] ints, re](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/382500/slide-26.jpg)




Гражданская позиция
Презентация на тему Классификация моллюсков
Презентация на тему Известные люди России
Презентация на тему Голландия
флагман мирового производства клинкера
Функция или услуга?
ОГБОУ СПО «Шарьинский аграрный техникум Костромской области»Отделение «Садово-парковое и ландшафтное строительство»
ИНФОРМАЦИЯ
Национальные парки США
МОУ «СОШ №7», г. Колпашево, Томской обл. Руководители: Пшеничникова Т.А., Тверитина Н. А. Команда учащихся: Пшеничникова Дарья, Даренс
Название торговой точки ООО / ИП
Презентация на тему Логика и ее задания
ООО Мебельторг. Направления развития бизнеса
The forgotten symbols of the USA
Простое, эффективное и безопасное решение для службы технической поддержки
Отчетпредседателя Студенческого советаза период с 13 ноября 2008 года по 21 апреля 2010 года
Мифы Древней Греции
город
(1) За окном сентябрь. (2) Озябла за окном и захворала осинка. (3) Пригорюнилась, свесила листы. (4) Вскоре занедужила берёзка. (5) Поникли
Финансирование инновационной деятельности. Финансовые инновации в современной России
Свадьба в романтическом элегантном стиле
Загадки круга
The united states of america
Информационные технологии в дизайне
Курьер доставляющего сервиса Чекбокс. Тренинг
Геральдическая латынь
Мотив былого в лирике Валерия Брюсова
Nutzen USB