100% de satisfacción garantizada Inmediatamente disponible después del pago Tanto en línea como en PDF No estas atado a nada 4,6 TrustPilot
logo-home
Ensayo

Event Driven Programming Assignment 1

Puntuación
-
Vendido
-
Páginas
22
Grado
A
Subido en
08-05-2022
Escrito en
2017/2018

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.

Institución
Grado









Ups! No podemos cargar tu documento ahora. Inténtalo de nuevo o contacta con soporte.

Escuela, estudio y materia

Nivel de Estudio
Editores
Tema
Curso

Información del documento

Subido en
8 de mayo de 2022
Número de páginas
22
Escrito en
2017/2018
Tipo
Ensayo
Profesor(es)
Desconocido
Grado
A

Temas

Vista previa del contenido

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
$11.94
Accede al documento completo:

100% de satisfacción garantizada
Inmediatamente disponible después del pago
Tanto en línea como en PDF
No estas atado a nada

Conoce al vendedor
Seller avatar
ItsKenzie
5.0
(9)

Documento también disponible en un lote

Conoce al vendedor

Seller avatar
ItsKenzie University
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
20
Miembro desde
6 año
Número de seguidores
10
Documentos
78
Última venta
2 año hace
IT and Cyber Security Notes For Computing Students

I prepare and sell top quality notes and essays that are concise and easy to understand to fellow computing students. It can be overwhelming when you get your first few projects or assignments, using my notes and essays can help you to better understand the modules and hopefully help you get the grades you want. Thanks for visiting my profile, feedback is always appreciated.

5.0

9 reseñas

5
9
4
0
3
0
2
0
1
0

Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes