C# Basics / GUI App Flashcards

1
Q

How are the GUIs in C# driven?

A

They are event driven (mouse clicks, keystrokes etc…)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Describe Generic Programming

A

It allows you to define a class with placeholders for the type of its fields, methods, parameters, etc. Generics replace these placeholders with some specific type at compile time.

A generic class can be defined using angle brackets <>.

Example:

class MyGenericClass<t></t>

(You can take any character or word instead of T.)

Now, the compiler assigns the type based on the type passed by the caller when instantiating a class.

https://www.tutorialsteacher.com/csharp/csharp-generics

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Describe Functional Programming

A

With functional programming, you specify what you want to accomplish in a task, but not how to accomplish it. For example, with Microsoft’s LINQ you can say, “Here’s a collection of numbers, give me the sum of its elements

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the Benefits of functional programming?

A

You do not need to specify the mechanics of walking through the elements and adding them into a running total one at a time — LINQ handles all that for you. Functional programming speeds application development and reduces errors

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does CLR stand for?

A

Common Language Runtime

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the Common Language Runtime?

A

The Common Language Runtime (CLR) executes .NET programs and provides functionality to make them easier to develop and debug. The CLR is a virtual machine (VM)—software that manages the execution of programs and hides from them the underlying operating system and hardware

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are some benefits of the CLR?

A

The CLR provides various services to managed code: - integrating software components written in different .NET languages - error handling between such components, - enhanced security, - automatic memory management and more

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How does the CLR work?

A

Managed code is compiled into machine-specific instructions in the following steps: - First, the code is compiled into Microsoft Intermediate Language (MSIL). Code converted into MSIL from other languages and sources can be woven together by the CLR—this allows programmers to work in their preferred .NET programming language. The MSIL for an app’s components is placed into the app’s executable file—the file that causes the computer to perform the app’s tasks. - When the app executes, another compiler (known as the just-in-time compiler or JIT compiler) in the CLR translates the MSIL in the executable file into machine-language code (for a particular platform). - The machine-language code executes on that platform.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is language Interoperability?

A

The .NET Framework provides a high level of language interoperability. Because software components written in different .NET languages (such as C# and Visual Basic) are all compiled into MSIL, the components can be combined to create a single unified program. Thus, MSIL allows the .NET Framework to be language independent

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

When do you change the name of form controls?

A

Only when the controls have an active role in the form. eg buttons can be clicked, check boxes can be checked, and some labels are dynamic and will change text, but static labels that will never change do not need to be renamed to something meaningful.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the naming convention for controls?

A

start with a lower case letter and camelCase

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is step 1 of Developing an application?

A
  • Clearly define what the program is to do. For example, the Wage Calculator program: - Purpose: To calculate the user’s gross pay - Input: Number of hours worked, hourly pay rate - Process: Multiply number of hours worked by hourly pay rate (result is the user’s gross pay) - Output: Display a message indicating the user’s gross pay
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is step 2 of Developing an application?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What us step 3 of Developing an application?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is step 4 of Developing an Application?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is step 5 of Developing an Application?

A
17
Q

What is step 6 of Developing an Application?

A
18
Q

What is step 7 of Developing an Application?

A
19
Q

What is step 8 of Developing an Application?

A
20
Q

What is step 9 of Developing an Application?

A
21
Q

What is step 10 in Developing an application?

A
22
Q

What is step 11 in Developing an application?

A
23
Q

How do you create a single-line comment?

A

//

24
Q

How do you create an XML-style comment?

A

///

Different context depending on what item you are commenting.

eg.

///

///

///

///

///

25
Q

What is a “using” directive?

A

A using directive tells the compiler where to look for a predefined class that’s used in an app.

  • Predefined classes are organized under namespaces - named collections of related classes. Collectively, .NET’s predefined namespaces are known as the .NET Framework Class Library. The System namespace contains the predefined Console class and many other useful classes.