MID Term exam Flashcards
(38 cards)
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: