[Solved] CPSC 223N Assignment 2

$25

File Name: CPSC_223N_Assignment_2.zip
File Size: 207.24 KB

SKU: [Solved] CPSC 223N Assignment 2 Category: Tag:
5/5 - (1 vote)

Traffic Signal

Introduction

Make a traffic light in your computer using C#.

User Interface

In this course we make lots of user interfaces. During the technical phase of your future job interviews if you are asked what do you know about C# you are certainly qualified to say that I made a lot of user interfaces.

For this assignment make a form that will hold your traffic light. The traffic light appears to be embedded in the form. The following is an illustration of the traffic light inside the form. The example shows the red light on, and the yellow and green lights are off.

Only one light is on at any time. If the green light is on then the other two lights are grayed out.

Programming specifications

When the program starts the traffic light is off (no electricity).

When the user clicks on Start the traffic begins normal operations at the default speed slow, which is explained in the next paragraphs.

If the user clicks on Pause then the traffic light freezes. The traffic signal does not turn off the electricity; it simply pauses where it is. When Pause is clicked the string Pause on that button changes to Resume. When Resume is clicked the string Resume changes to the string Pause.

If the user clicks on Resume then the traffic signal begins operation from the point in time when operation was suspended.

At any time the user may change the speed (rate of change) by clicking on one of the radio buttons. Here are the rates for slow and fast operation. The numbers represent number of seconds each light is on.

Red light Green light Yellow light
Fast 4.0 s 3.0 s 1.0 s
Slow 8.0 s 6.0 s 2.0 s

The table shows how many seconds the light remains on in each mode of operation. For example, in the Slow mode of operation the red light is on for 8 seconds, followed by the yellow light on for 2.0 second, followed by the green light on for 6.0 seconds.

Comments in source code

Use the rules of Assignment 1 for placing comments in the source files of this program.

Script files

Make a script file for Assignment 2 in the same way as you did in the previous assignment. The script file is as much a part of the program as the C# source files .

User Interface qualities

Program executes and shows a UI.

UI shows a title strip across the top with the programs name and the authors name

Outline of a traffic signal appears (3 circles)

The graphic area around the traffic signal has a distinguishing official highway color.

The control strip has a unique color

There are slow, medium, fast radio buttons in the control strip

There is a button labeled Start.

There is a button labeled Pause.

There is an Exit buttonRun-time functionality

The signal does not function until the start button is clicked.

Visually the red light is longest, green is middle, yellow is shortest in duration.

No two lights are on concurrently.

At least one light is on at any given instant.

The user can change the speed of flashing without exiting from the progTo test your timing: hold your cell phone with the clock displayed near your computer monitor. Run the program in slow mode. Check if the red light stays on exactly 8 seconds before changing to yellow.

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] CPSC 223N Assignment 2
$25