pause at 41 minutes
This commit is contained in:
37
C# Full Course for free/5.arithmetic.md
Normal file
37
C# Full Course for free/5.arithmetic.md
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
# Arithmetics
|
||||||
|
|
||||||
|
## additions
|
||||||
|
|
||||||
|
```C#
|
||||||
|
int friends = 5;
|
||||||
|
friends = friends + 1;
|
||||||
|
friends++;
|
||||||
|
```
|
||||||
|
|
||||||
|
## substrack
|
||||||
|
|
||||||
|
```C#
|
||||||
|
friends = friends - 1;
|
||||||
|
friends -= 1;
|
||||||
|
```
|
||||||
|
|
||||||
|
## multiplications
|
||||||
|
|
||||||
|
```C#
|
||||||
|
friends = friends * 2;
|
||||||
|
friends *= 2;
|
||||||
|
```
|
||||||
|
|
||||||
|
## division
|
||||||
|
|
||||||
|
```C#
|
||||||
|
friends = friends / 2;
|
||||||
|
friends /= 2;
|
||||||
|
```
|
||||||
|
|
||||||
|
## modulus
|
||||||
|
|
||||||
|
```C#
|
||||||
|
friends = friends % 3;
|
||||||
|
```
|
||||||
|
|
||||||
86
C# Full Course for free/6.Math Class.md
Normal file
86
C# Full Course for free/6.Math Class.md
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
# Math Class
|
||||||
|
|
||||||
|
## Pow
|
||||||
|
|
||||||
|
raise to the power of x
|
||||||
|
|
||||||
|
```C#
|
||||||
|
double a = 3;
|
||||||
|
double b = Math.Pow(a,2);
|
||||||
|
```
|
||||||
|
|
||||||
|
## Sqrt
|
||||||
|
|
||||||
|
for the squqre Root
|
||||||
|
|
||||||
|
```C#
|
||||||
|
double a = 3;
|
||||||
|
double b = Math.Sqrt(a);
|
||||||
|
```
|
||||||
|
|
||||||
|
## Abs
|
||||||
|
|
||||||
|
for the absolute value
|
||||||
|
|
||||||
|
```C#
|
||||||
|
double a = -3;
|
||||||
|
double b = Math.Abs(a);
|
||||||
|
```
|
||||||
|
|
||||||
|
## round
|
||||||
|
|
||||||
|
Round a numeber
|
||||||
|
|
||||||
|
```C#
|
||||||
|
double a = 3.14;
|
||||||
|
double b = Math.Round(a);
|
||||||
|
```
|
||||||
|
|
||||||
|
## Ceiling
|
||||||
|
|
||||||
|
round up
|
||||||
|
|
||||||
|
```C#
|
||||||
|
double a = 3.14;
|
||||||
|
double b = Math.Ceilling(a);
|
||||||
|
```
|
||||||
|
|
||||||
|
## Floor
|
||||||
|
|
||||||
|
round down
|
||||||
|
|
||||||
|
```C#
|
||||||
|
double a = 3.99;
|
||||||
|
double b = Math.Floor(a);
|
||||||
|
```
|
||||||
|
|
||||||
|
## Max
|
||||||
|
|
||||||
|
find the max value
|
||||||
|
```C#
|
||||||
|
double a = 3.99;
|
||||||
|
double x = 5;
|
||||||
|
double b = Math.Max(a,x);
|
||||||
|
```
|
||||||
|
## Min
|
||||||
|
|
||||||
|
find the min value
|
||||||
|
```C#
|
||||||
|
double a = 3.99;
|
||||||
|
double x = 5;
|
||||||
|
double b = Math.Min(a,x);
|
||||||
|
```
|
||||||
|
|
||||||
|
## Random
|
||||||
|
|
||||||
|
Generate a random Number
|
||||||
|
|
||||||
|
```C#
|
||||||
|
Random random = new Random();
|
||||||
|
|
||||||
|
// for int
|
||||||
|
int num = random.Next(1, 7);
|
||||||
|
|
||||||
|
// for Double
|
||||||
|
double num = radom.NextDouble();
|
||||||
|
```
|
||||||
8
C# Full Course for free/7.hypotenuse_calculator.md
Normal file
8
C# Full Course for free/7.hypotenuse_calculator.md
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# hypotenuse calculator
|
||||||
|
|
||||||
|
in this project we will cover how to implement
|
||||||
|
the hypotenuse theorem
|
||||||
|
|
||||||
|
$$
|
||||||
|
a^2 + b^2 = c^2
|
||||||
|
$$
|
||||||
Reference in New Issue
Block a user