100% tevredenheidsgarantie Direct beschikbaar na je betaling Lees online óf als PDF Geen vaste maandelijkse kosten
logo-home
Event Driven Programming Assignment 1 $10.65
In winkelwagen

Essay

Event Driven Programming Assignment 1

 0 keer verkocht
  • Vak
  • Instelling

The document contains all criteria for assignment 5: Unit 14 Criteria: P2, P3, P4, P5, P6, M2, M3, M4, D2. Unit 6 Criteria P6, M2, D2. I received full marks for this assignment.

Voorbeeld 2 van de 22  pagina's

  • 8 mei 2022
  • 22
  • 2017/2018
  • Essay
  • Onbekend
  • A
avatar-seller
UNIT 14 – P2/P4


The start button starts the
code and the package starts
to move after this button is
clicked. These labels show the user
how many total packages
there are of that specific
type.




The reset button allows the user
to click it to start the process
over so that the package moves
These labels show the
to the beginning of the conveyor
percentage of unsealed and
belt. These red boxes are the
the number of unsealed
packages. sensors, these were used
within the code to detect
the different package types.

, 1 Public Class Form1
2 Dim Type As Integer
3 Dim Sealed As Boolean
4 Dim NumbSmall As Byte 'This adds the NumbSmall as a varible and stores it as a
byte
5 Dim NumbMedium As Byte 'This adds the NumbMedium as a variable and stores as byte
6 Dim NumbLarge As Byte 'This adds NumbLarge as a variable and stores it as a byte
7 Dim NumbTotal As Byte '
8 Dim NumbUnsealed As Byte
9 Dim NumbUnSeal As Byte
10
11 Private Sub BtnStart_Click(sender As Object, e As EventArgs) Handles
BtnStart.Click
12 Type = 0
13 Randomize()
14 Type = Type + Int(Rnd() * 4) + 1 'this defines the amount of images it shows
15 Sealed = Sealed + Int(Rnd() * 2) + 1 'this is a true or false for the
unsealed packages
16
17 TmrMove.Enabled = True
18
19 Select Case Type
20 Case 1 'This is a Small Package Case
21 PicPackage.Image = My.Resources.Small_Box1
22
23 Case 2 'Medium Package Case
24 PicPackage.Image = My.Resources.Medium_Box
25
26 Case 3 'Case for the Large Package
27 PicPackage.Image = My.Resources.Large_Box
28
29 Case Else
30 PicPackage.Image = My.Resources.Unsealed
31
32 End Select
33
34
35 End Sub
36
37 Private Sub CheckCollision()
38
39 If PicPackage.Bounds.IntersectsWith(PicSensorS.Bounds) = True And Type = 1
Then
40 TmrMove.Enabled = False
41 MessageBox.Show("Small Package Detected")
42 NumbSmall = NumbSmall + 1 'this adds up the Small Packages so that the
total shows next to the label
43 LblNumbSmall.Text = NumbSmall
44 NumbTotal = NumbTotal + 1
45 LblTotal.Text = NumbTotal.ToString
46
47 ElseIf PicPackage.Bounds.IntersectsWith(PicSensorM.Bounds) = True And Type =
2 Then
48 TmrMove.Enabled = False
49 MessageBox.Show("Medium Package Detected")
50 NumbMedium = NumbMedium + 1 'this adds up the Medium Packages so that
the total shows next to the label
51 LblNumbMedium.Text = NumbMedium
52 NumbTotal = NumbTotal + 1
53 LblTotal.Text = NumbTotal.ToString
54
55 ElseIf PicPackage.Bounds.IntersectsWith(PicSensorL.Bounds) = True And Type =
3 Then
56 TmrMove.Enabled = False
57 MessageBox.Show("Large Package Detected")
58 NumbLarge = NumbLarge + 1 'this adds up the Large Packages so that the
total shows next to the label
59 LblNumbLarge.Text = NumbLarge
60 NumbTotal = NumbTotal + 1
61 LblTotal.Text = NumbTotal.ToString
62

Dit zijn jouw voordelen als je samenvattingen koopt bij Stuvia:

Bewezen kwaliteit door reviews

Bewezen kwaliteit door reviews

Studenten hebben al meer dan 850.000 samenvattingen beoordeeld. Zo weet jij zeker dat je de beste keuze maakt!

In een paar klikken geregeld

In een paar klikken geregeld

Geen gedoe — betaal gewoon eenmalig met iDeal, creditcard of je Stuvia-tegoed en je bent klaar. Geen abonnement nodig.

Direct to-the-point

Direct to-the-point

Studenten maken samenvattingen voor studenten. Dat betekent: actuele inhoud waar jij écht wat aan hebt. Geen overbodige details!

Veelgestelde vragen

Wat krijg ik als ik dit document koop?

Je krijgt een PDF, die direct beschikbaar is na je aankoop. Het gekochte document is altijd, overal en oneindig toegankelijk via je profiel.

Tevredenheidsgarantie: hoe werkt dat?

Onze tevredenheidsgarantie zorgt ervoor dat je altijd een studiedocument vindt dat goed bij je past. Je vult een formulier in en onze klantenservice regelt de rest.

Van wie koop ik deze samenvatting?

Stuvia is een marktplaats, je koop dit document dus niet van ons, maar van verkoper ItsKenzie. Stuvia faciliteert de betaling aan de verkoper.

Zit ik meteen vast aan een abonnement?

Nee, je koopt alleen deze samenvatting voor $10.65. Je zit daarna nergens aan vast.

Is Stuvia te vertrouwen?

4,6 sterren op Google & Trustpilot (+1000 reviews)

Afgelopen 30 dagen zijn er 64670 samenvattingen verkocht

Opgericht in 2010, al 15 jaar dé plek om samenvattingen te kopen

Begin nu gratis

Laatst bekeken door jou


$10.65
  • (0)
In winkelwagen
Toegevoegd