How to add items to ListBox?
ListBoxName.Items.Add(Item);
namesListBox.Items.Add(“Chris”);
namesListBox.Items.Add(“Alicia”);
namesListBox.Items.Add(10);
namesListBox.Items.Add(20);
namesListBox.Items.Add(17.5);
How to clear items to ListBox?
How to count items stored in ListBox?
What is for loop specially designed for?
List out 3 actions that are required for the for loop
What is the format for for loop?
for ( initializationExpress; textExpression; updateExpression ){}
List out examples for using for loop
for (int count = 0; count <=100; count += 10) → count = count + 10
{
MessageBox.Show(count.ToString());
}
for (int count = 10; count >=0; count–)
{
MessageBox.Show(count.ToString());
}
What does the while loop causes?
List out 2 parts for while loop
List out format for while loop
counter declaration
while ( BooleanExpression )
{
Statements;
counter increment / decrement
}
What is the term used each time the loop executes its statements again and again?
What is a dead loop?
What is the issue caused by a loop become a dead loop?
// count variable is always greater than 5
int count = 5;
while (count > 5)
{
MessageBox.Show(“Hello”);
count=count+1;
}
List out 3 ways to increase 1of the value
List out 3 ways to decrease 1of the value
What is Postfix Mode?
count++
int a, b;
a = 50;
MessageBox.Show(a++); // 50
b = a;
MessageBox.Show(a); // 51
MessageBox.Show(b); //51
What is Prefix Mode?
–count
int a, b;
a = 50;
MessageBox.Show(++a); // 51
b = a;
MessageBox.Show(a); //51
MessageBox.Show(b); //51
Is do-while loop a posttest loop?
What is the format for do-while loop?
do
{
statement(s);
} while (BooleanExpression);