removeAt
method (removes element at a given index).list.removeAt(3)
removes the element at index 3.split
method with separators.string.split(",")
splits a string into an array of strings using a comma as a separator.string.split(" ")
splits a string into an array of strings using space as a separator.Random.Next(0, 10)
generates a number between 0 (inclusive) and 10 (exclusive).WriteLine
) will not be heavily penalized.try-catch
blocks.double
for decimal numbers).int
or double
.try-catch
blocks and display error messages using MessageBox.Show()
.Tests understanding of if
, else if
, and else
statements.
Example 1: Assign message based on score
string message;
int score = ...;
if (score < 50)
message = "Fail";
else
message = "Good";
Example 2: Extend branch with an "Excellent" category
string message;
int score = ...;
if (score < 50)
message = "Fail";
if (score >= 80)
message = "Excellent";
else
message = "Good";
for
loop to draw a certain number of objects on a Canvas.for
when you know the number of iterations.while
to check conditions until a specific condition is true.graphics.DrawLine(Pen pen, int x1, int y1, int x2, int y2)
graphics.DrawRectangle(Pen pen, int x, int y, int width, int height)
graphics.DrawEllipse(Pen pen, int x, int y, int width, int height)
DrawRectangle
; ellipse is bounded by a rectangle defined by x, y, width, and height.X = X_center - r
Y = Y_center - r
void
, int
, double
)void
)File.OpenText
, new StreamReader
)ReadLine
)EndOfStream
property)Close
)Three questions, A, B, and C.
Know how to declare an array.
Access elements using index (starting from 0).
Find the length of array use length property.
Two ways to loop array: for loop and for each.
Write code to check how many elements meet certain conditions.