Содержание
- 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)




О внедрении курса «Основы религиозных культур и светской этики» (По материалам лекций курса «Духовно-нравственная культура в ус
Предмет и содержание хирургической стоматологии. Асептика и антисептика при операциях на лице. Методы обследования пациента в кли
Развитие беспроводного доступа в КОМСТАР Комстар-ОТС, Михаил Берлизев Круглый стол CNews «Беспроводные технологии в России» 11 апрел
Презентация на тему Мир правильных многогранников
Ольга Германовна Павишко Учитель русского языка и литературы МОУ СОШ №4 им. Н.А.Некрасова с углубленным изучением английского яз
Копченый перец Аридея
История легкой атлетики
Геология
Рождество Христово В Истории России
Дом –музей Островского в Замоскворечье
Признаки делимости на 10, на 5, на 2
Общее строение печатных машин
Организация деятельности Ассоциации«Совет муниципальных образований Томской области»
Сравнение качества воды Ладожского озера в парке «Ладожские шхеры» и вблизи города Сортавала
С давнейших времён
ProДеньги. Учимся составлять бюджет. Планируем финансовые потоки
Алкадиены
Транспортно-экспедиционная компания СТЭС. Грузоперевозки в Якутию и на север Иркутской области
Отработка навыков турпроектирования на основе ценностных ориентиров потребителей
Психологические растройства и состояния
Мосгормаш -технопарк будущего
Corpuscular elements of blood
Тип Моллюски (Mollusca)
Программа поддержки многодетных семей в РФ
Внедрение систем менеджмента качества (СМК) – переход к «тонкой» настройке управления в энергокомпаниях Холдинга РАО «ЕЭС Росс
Физкультурно-оздоровительный комплекс с универсальным игровым залом 42х24
Презентация на тему Изобретение радио
SEE.ua