Arithmetic Operators Flashcards

(25 cards)

1
Q

What are the three types of operators?

A

Unary
Binary
Ternary

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

What does the + operator do?

A

Addition (total = cost + tax;)

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

What does the - operator do?

A

Subtraction (cost = total - tax;)

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

What does the / operator do?

A

Division (salePrice = original / 2;)

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

What does the % operator do?

A

Modulus (remainder = value % 3;)

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

What does the * operator do?

A

Multiplication (tax = cost * rate;)

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

When a int is divided by another int what happens?

A

The remainders shall be discarded

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

What does the method Math.Pow() do?

A

Returns a specified number raised to a specific power

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

What does the method Math.Sqrt() do?

A

Returns the square root of a specific number

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

What does the method Math.Round() do?

A

Rounds to nearest integer, or to specified number of digits (result = Math.Round(1.3768); = 1 or Math.Round(1.3768, 2); = 1.38)

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

What does the += combined operator mean?

A

x = x + 5 (x += 5;)

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

What does the -= combined operator mean?

A

x = x - 5 (x -= 5;)

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

What does the *= combined operator mean?

A

x = x * 5 (x *= 5;)

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

What does the /= combined operator mean?

A

x = x / 5 (x /= 5;)

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

What does the %= combined operator mean?

A

x = x % 5 (x %= 5;)

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

What does the const keyword do to a variable?

A

It is used to make a variable a constant that cannot be changed (const double GST_RATE = 0.05;)

17
Q

What is a booleon value?

A
It is a data type that can either be True or False (staticvoidMain(string[] args)
{
bool isManager;
isManager = true;
Console.WriteLine(isManager);
isManager = false;
Console.WriteLine(isManager);
})
18
Q

What is a char value?

A
A char is a value that is a single letter (staticvoidMain(string[] args)
{
charletter;
letter = 'A';
Console.WriteLine(letter);
letter = 'B';
Console.WriteLine(letter);
})
19
Q

What is Parsing?

A

It will convert a value into another value (age = int.Parse(Console.ReadLine());)

20
Q

What is the < operator?

A

Means less than

21
Q

What is the <= operator?

A

Less than or equal to (≤)

22
Q

What is the > operator?

23
Q

What is the >= operator?

A

Greater than or equal to(≥)

24
Q

What is the == operator?

25
What is the != operator?
Not Equal to (≠)