Data types Flashcards

1
Q

Boolean data type

A

A type of variable which has only one of two values: true or false.

Example

bool Answer;
Answer=True;

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

Integer data type

A

A type of variable that can contain whole numbers

Example

integer cakes;
cakes = 12;

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

Float data type

A

A type of variable that can contain numbers with a decimal point

Example

float race_time;
race_time = 9.98;

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

String data type

A

A type of variable that can contain a number of characters or string

Example

string shout;
shout = “I am angry”;

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

Unsigned short integer data type

A

A type of variable that can hold positive whole numbers

Example

ushort weekdays;
weekdays = 7;

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

Class

A

A data structure that combines different elements

Example

class car
(
int number_of_doors = 4;
int number_of_wheels = 4;
str colour = "green";
)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Object

A

An implementation, example or instance of a class

e.g. if the class is a car, a black jaguar is an object

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

Syntax

A

The structure of the language - like sentences, full stops, commas, quotation marks

Example: An if statement has a condition in () and the consequence in braces/curly brakets

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

.NET framework

A

Libraries of code pre-built by Microsoft that you can use in Visual Studio

e.g. System includes functions for maths, e.g. Math.Abs() is a method that returns the absolute value (just the positive value) of what is in the brackets.

Math.Abs(-7) = 7

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

Common Language Runtime (CLR)

A

Protective bubble that enables your code to run without impacting on other open windows but using the hardware of the computer. Prevents the software developer from doing damage to the computer.

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

Comments

A

Useful text that allows coders to understand how code is planned to work

Example

counter = counter + 1; /* increment the frame counter each iteration */

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

Indentation

A

How much text is moved from the left edge of the screen

Example

if(Tristan==’drunk)
(
Console.WriteLine(“Tristan is drunk”);
)

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

method

A

a block of code that can be called by its name and passed parameters

Example

print_text(string)
(
Console.WriteLine(string);
)

print_text is a method
string is the parameter that is passed

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

namespace

A

A block of code containing classes which may contain methods

Example

namespace HelloWorld
(
block of code with class Program
)

class Program is inside namespace HelloWorld

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

member access

A

The “.” in naming of methods

Example

Console.ReadLine(),

Access the method ReadLine in the class Console
(N.B. Console is a class defined in the .NET framework in the library called System)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

argument/parameter

A

another word for the variables that are passed into a method. Also called a parameter

Example

Console.WriteLine(string);

string is the argument/parameter passed into the method WriteLine in the class Console

17
Q

Solutions

A

A collection of projects and files that make a complete software development. Structure is provided as a template in Visual Studio. Solutions can be explored with the Solution Explorer in Visual Studio.

Example

FishORama.sln containing two projects

18
Q

Project

A

Collection of resources e.g. .cs files, image files, configuration files that make up a part of a solution. Project get compiled into a .NET assembly.

Example

FishORama

19
Q

declaring variables

A

code that defines what variables are required later in the program

e.g. int counter = 1;

define an integer variable called counter and sets its initial value to 1

20
Q

main()

A

The method that is at the core of every C# project. There will only be one main() statement in the project.

Example

static void Main(string(),args)
(
Console.WriteLine(“Hello World”);
)

21
Q

assignment operator

A

”=”
this assigns what is on the right hand side and assigns it to the left hand side

Example
y = x +3;

variable y is assigned the value from variable x plus 3

22
Q

concatenation

A

A long way of saying we combine things in sequence

Example

Concatenating “Tristan” and “Weir”, leads to “Tristan Weir”

23
Q

naming convention

A

the rules that we apply to determine the names, e.g. of variables

Example

Camelcase naming convention uses combined words to form variable names & requires that you use a small letter for the first word and capital letters for subsequent words in the variable. This is intended to make it more readable.

int myLoopCounter; /* counter for loops */

24
Q

intellisense

A

A feature of Visual Studio that gives you helpful prompts

Example

When typing in the name of a variable, intellisense shows you the existing options and allows you to select one to ensure you get the correct name and the right spelling