MID Term exam Flashcards
Program
a set of coded instructions that enables a machine to perform a desired sequence of operations
Coding Sequence of events
Analyze the problem, Develop interface, Design the logic, code the logic, test and debug, Complete documentation
How to control labels in C#
you can put commands on labels, by typing the specific label and with a ( . ) type what command you want
How to use picture boxes
you can upload a file to picture boxes, and change the import from project file which will come with the saved code, or from local importing that will only exists on your hard drive
Button (text/click event)
if you type .text it will change the text of anything, click events says every time the button is clicked the code is read
Text boxes
allows the user to type in these
String
Any number of alphabetic, numerical, and special characters. they are read differently as numbers, not for calculations
String continuation
using a string in quotes, you can add + after with another string following
Data types non-decimal length (smallest to largest)
short, int, long
Data types for Decimal numbers (smallest to largest)
float, double, decimal
Bool
Boolean, either true or false value
Date
ranges from Jan, 1 0001 to December 31st 9999
and time 0:00:00 to 23:59:59
Declarations (establishing variables)
this allows you to set an ambiguous name to a value, to organize and do specific calculations.
.Tostring
c# will not display numbers so they must be converted to strings so they can be displayed, and no longer used for calculations
in form .Tostring(“0.0”)
.Parse
for example int.parse will change string into data types used for calcualtions
.TryParse
try parse will convert strings to data types, but if this is not possible this will default to the number 0
Debugging Breakpoints
this will break the running code at this particular step, indicated with a red dot and will simulate what the code ran
Debugging Single stepping
using f11, you can step into and look at what the code is doing at every point, one step at a time
IF statements
This will trigger a Boolean reaction, verifying what steps would happen if true or false, these are between brackets where code will instruct what to do next
Else statements
Following a IF boolean statement , if the value specified is not met, else in brackets will contain what to do next IF (example == true) { } else { }
how to use NOT decision
! (x < 10) use “ ! “ outside parenthesis to say not
AND decision
(x >= 10) && (x <= 20)
use two && between two statements
OR decision
(x < 10) || (y < 10)
use || between two statements
Switch Decisions
using a constant variable switch (x) { list different cases and what steps need to be done int them with typing break; at the end to show that the condition is finished switch (x) { case 1: points = points + 1; break:
Loops: While
this loop will continue until a certain condition is met and this condition follows “While”
Loops: For
this loop is used for a condition, or range or values that we already know,.
Loops: Do
Do loops will perform a specific action as the condition is completed, this loops starts with do and follows with a while after Do { } While... ( )
Radio buttons and groups
radio buttons only allow one option to be selected at a time, so groups must be set if you want different categories of options to be chosen instead of one
Number Generator
this will make a number generator, you must establish a variable, type Random (name of gen) = new.Random();
then you want the scope
variable = (name of gen).next(0,21);
int Gen1; Random Numbergenerator1 = new Random(); Gen1 = Numbergenerator1.Next(0,21);
the range should be from the base number to a set number but the set number must be +1
Number Generator
this will make a number generator, you must establish a variable, type Random (name of gen) = new.Random();
then you want the scope
variable = (name of gen).next(0,21);
int Gen1; Random Numbergenerator1 = new Random(); Gen1 = Numbergenerator1.Next(0,21);
the range should be from the base number to a set number but the set number must be +1
Standard Deviation
from a range of data points, SD = SQ ROOT of ((a number from the value) minus (the mean)^2 / total number of values)
Form level Variables
Variables set at the form level so this variable is known in every part of the code
Normal Distribution
usually a bell curve showing the range of the averages
Uniform Distribution
exact distribution numbers, like a dice can only have 1-6 possibilities
Poisson Distribution
the formula used to calculate the rate that something will happen when given the average occurrences
Series Circuits
circuits that get the same amount of power throughout, this doesn’t have and branching (ladder type) connections… kind of like a circular track.
Parallel Circuits
circuits that have multiple different paths with the same voltage, depending on the resistance this will change how much voltage is found through the different branches.
OHMS law
V = IR