Week 3 Flashcards
How do you get pi?
Math.PI;
What namespace does the Math class use?
using System;
How do call a cosine function?
Math.Cos(x);
What namespace does BigInteger need?
using System.Numerics;
Definition of static checking:
bug found automatically before program even runs.
Definition of Dynamic checking:
bug found automatically during runtime
No checking
The complier won’t find the error you have to. Code probably won’t run correctly.
What types of errors can static checking find.
Syntax errors, wrong names, wrong number of arguments, wrong argument types, wrong return types
What type of errors can dynamic checking catch?
illegal argument values, unrepresentable return values, out-of-range indexes, calling a method on a null object reference.
What does the “readonly” keyword do?
readonly indicates that a field can only be assigned at the time of declaration or in a constructor of that class.
What does the const keyword do?
declares a constant local or a constant field (only initialized at its declaration, and cannot be changed after)