Homework3

Homework3 - two The elevator passes two and stops at three...

This preview shows pages 1–2. Sign up to view the full content.

CS130 Kevin Deggelman May 13, 2009 Homework 3 1. Statements that are true: a. 1, 4,5 2. a. 1. The elevator starts at the floor one and the passenger requests to go up to floor three. The doors open then close at floor three, and the elevator waits at floor three for a new request. 2. The elevator starts at floor one and the third floor button is pressed. It begins to travel, and immediately thereafter an up request is signaled by floor two. Once floor two is reached and a passenger enters and hits the button for floor three. The elevator then continues, stopping at floor three to let one passenger out, while

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
letting another passenger in. The new passenger hits the floor one button. The elevator goes past floor two and stops at floor one. 3. The elevator starts at floor one and the third floor button is pressed. It begins to travel upward. Immediately following this, a down request is signaled from floor
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: two. The elevator passes two and stops at three before it comes back down and stops at two. The elevator then returns to floor one, opens the door and waits for a new request. 4. The elevator starts at floor one. Floor two indicates a down request, followed closely by floor three. Floor two then indicates an up request. The elevator stops at floor two continues on to three five. It then comes back down and stops at floor two, then returns to floor one. 5. The elevator starts at floor one and up requested by floor two. The elevator reaches floor two and the third floor button is pressed. The elevator travels to three and lets its passenger off. 3. a. 100% Branch Coverage a = array size 6 key = 1 a = array size 6 key = 4 b. Bug – The bug is that if key is a negative number....
View Full Document

{[ snackBarMessage ]}

Page1 / 2

Homework3 - two The elevator passes two and stops at three...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online