Logical Expressions, Sequence Diagrams, and Visual C# Flashcards
If quantity has a value of 10, evaluate the following expression.i. (quantity == 1 || quantity == 2):
ii. (quantity >= 3 && quantity < 10):
iii. (quantity > 10 && quantity <= 25):
i.:False
ii.True
iii.False
State and define any three (3) elements of a sequence diagram.
Lifeline: Represents the lifespan of an object.
Activation Bar: Represents the time an object is active.
Message: Communication between lifelines.
Give three examples of message communication between objects in a sequence diagram.
Synchronous Message
Asynchronous Message
Return Message
A young programmer is using Visual C# to simulate a moving rolling die on a form. Use above scenario to answer questions that follow.
i. What control is ideal to load the die?
PictureBox control is ideal to load the die.
Write a code snippet to set the die to start at a horizontal location of 20 pixels on the form.
pictureBoxDie.Location = new Point(20, pictureBoxDie.Location.Y);
The die is activated to start moving by the Timer control, which Timer event should be used
Timer Tick event should be used
What is the unit for Timer Interval property value?
The unit for Timer Interval property value is milliseconds.
Write a code snippet to stop the moving die at a horizontal location 420 pixels on the form.
if (pictureBoxDie.Location.X < 420)
{
pictureBoxDie.Location = new Point(420, pictureBoxDie.Location.Y);
timerDie.Stop();
}