
Questions in the topic of:
– Functions
– Arrays
– Winforms
Exam: Questions
Minimum grade to pass: 60%
Exam Day

Questions in the topic of:
– Functions
– Arrays
– Winforms
Exam: Questions
Minimum grade to pass: 60%
File-Explorer-App Menu
MessageBox-Result Open-File-Dialog Color-Dialog

We developed together in class a File Explorer which could open images, open text files and color labels
We learned how to create MessaegBox which shows buttons – and handle the option the user has selected in the message box
More topics covered:
Links:
Simon-game MessageBox UI-Thread new-Thread().Start Thread.Sleep const Mono

We developed together in class a Simon game – where the computer plays random colors and you have to repeat them (be careful: one wrong color and your out!)
We learned about the UI thread and creating a new worker thread
We learned about global scope of variables
We learned about Thread.Sleep
We learned how to create MessaegBox using: MessageBox.Show(…);
We learned about WinForm theory, and Mono project
More topics covered:

Links:
Whastapp ListBox KeyPress KeyDown Leave DateTime.Now KeyValue
We built a chat Application (like Whatsapp, is typing …)
We learned how to add ListBox and more events into our WinForm application.
More topics covered:
Links:
Calculator Button TextBox Click-Event Debug.WriteLine
We built our first calculator in Windows Form Application
We learned how to add buttons and click events into our WinForm application.
More topics covered:
Links:
Functions advanced, WinForm application, String, boolean
We learned the String and Boolean types and some basic usage.
We saw functions advanced features:
(See C# 5.0 IN A NUTSHELL: page 42)
– Arrays as parameter
– int (primitive) as parameter
– ref
– out
– default values
– params
– destructuring parameters
We created our first Window Forms application
– Hello world!
– Colored in Green 🙂
Links:
Functions, Memory Game, WriteLine($), C# website
Cool site to run c# code from the web: https://dotnetfiddle.net/
We learn how to use Console.WriteLine with $. for example:
int x = 10;
Console.WriteLine($”x is equal to : {x}”)
Memory Game project – due date 19/12/2018!
Functions:
– Use to module our code , and re-use the code
– Used with input parameters
– Used with return value
Arrays, code snippets
Introduction to Arrays: array is a storage for many elements in a same collection. i.e. list of 100 grades for a class
Array types:
– single dimension []
– matrix[,]
– jagged[][]
Initialize an array: i.e. array of 10 integers:
int[] grades = new int[10];
Get the array length: grades.length
for loop on the array:
for(int i = 0; i < grades.length; i++) { … }
Code Snippets:
Code snippets are used to paste code into the visual studio with a keyboard shortcut. i.e. “cw” + tab + tab write Console.WriteLine()
So, we can make our on shortcuts. In class we made an example of making a keyboard shortcut “ccr” which pastes:
Convert.ToInt32(Console.ReadLine());
see the video…
Exam Day

Questions in the topic of:
– while, do-while, for, prime numbers
– printing triangle horizontally and vertically
Minimum grade to pass: 70%
do-while, continue, break, prime numbers
Topics:
– Learning do-while: same as while except that a first iteration will always occur!
– continue-break out of loops:
continue: will skip to the next iteration
break: will exit the loop
– checking if a number is a prime number or not: run from 2 to number-1 and look for a divider which returns module of zero