Logical Expressions, Sequence Diagrams, and Visual C# Flashcards

1
Q

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):

A

i.:False
ii.True
iii.False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

State and define any three (3) elements of a sequence diagram.

A

Lifeline: Represents the lifespan of an object.
Activation Bar: Represents the time an object is active.
Message: Communication between lifelines.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Give three examples of message communication between objects in a sequence diagram.

A

Synchronous Message
Asynchronous Message
Return Message

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

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?

A

PictureBox control is ideal to load the die.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Write a code snippet to set the die to start at a horizontal location of 20 pixels on the form.

A

pictureBoxDie.Location = new Point(20, pictureBoxDie.Location.Y);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

The die is activated to start moving by the Timer control, which Timer event should be used

A

Timer Tick event should be used

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the unit for Timer Interval property value?

A

The unit for Timer Interval property value is milliseconds.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Write a code snippet to stop the moving die at a horizontal location 420 pixels on the form.

A

if (pictureBoxDie.Location.X < 420)
{
pictureBoxDie.Location = new Point(420, pictureBoxDie.Location.Y);
timerDie.Stop();
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly