0% found this document useful (0 votes)
2 views3 pages

Practical Example

The document contains a Java program that defines a class 'MyBug' with a main method where multiple instances of 'Gogga' are created, each representing a bug with specific colors and movements. The code includes various movement commands for the bugs, such as turning and moving in a grid-like environment. The program demonstrates basic programming concepts like object instantiation, loops, and method calls.

Uploaded by

jenniferjohn8666
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views3 pages

Practical Example

The document contains a Java program that defines a class 'MyBug' with a main method where multiple instances of 'Gogga' are created, each representing a bug with specific colors and movements. The code includes various movement commands for the bugs, such as turning and moving in a grid-like environment. The program demonstrates basic programming concepts like object instantiation, loops, and method calls.

Uploaded by

jenniferjohn8666
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

1 70 janice.

turnRight();
71 [Link]();
72 [Link]();
73 [Link]();
74 [Link]();
75 [Link]();
76 [Link]();
77 [Link]();
78 [Link]();
79 [Link]();
80 [Link]();
81 [Link]();
82 [Link]();
83 [Link]();
84 [Link]();
85 [Link]();
86 [Link]();
87 [Link]();
88 [Link]();
89 [Link]();
90 [Link]();
91 [Link]();
92 [Link]();
93 [Link]();
94
95 [Link]();
96 [Link]();
97 [Link]();
98 [Link]();
99 [Link]();
100 [Link]();
101 [Link]();
102 [Link]();
103 [Link]();
104 [Link]();
105 [Link]();
106 [Link]();
107
108 [Link]();
109 [Link]();
110 [Link]();
111 [Link]();
112 [Link]();
113 [Link]();
114 [Link]();
115 [Link]();
116
117 [Link]();
118 for (int i = 0; i < 14; i++) [Link]();;
119 [Link]();
120 for (int i = 0; i < 7; i++) [Link]();
121 [Link]();
122 for (int i = 0; i < 14; i++) [Link]();
123 [Link]();
124 for (int i = 0; i < 7; i++) [Link]();
125
126 }
127 } Name Surname
2 import [Link]; //by
3 import [Link];
4
5 public class MyBug {
6
7 public static void main(String [] args){
8
9 Gogga betty;
10 Gogga janice;
11 Gogga piet;
12 Gogga nancy;
13 Gogga trevor;a
14
15 betty = new Gogga(2,2);
16 [Link]([Link]);
17
18 janice = new Gogga(5,1);
19 [Link]([Link]);
20
21 piet = new Gogga(10,1);
22 [Link]([Link]);
23
24 trevor = new Gogga(10,5);
25 [Link]([Link]);
26
27 nancy = new Gogga(0,0);
28
29
30 [Link]();
31 [Link]();
32 [Link]();
33 [Link]();
34 [Link]();
35 [Link]();
36 [Link]();
37 [Link]();
38 [Link]();
39 [Link]();
40 [Link]();
41 [Link]();
42 [Link]();
43 [Link]();
44 [Link]();
45 [Link];
46 [Link]();
47 [Link]();
48 [Link]();
49 [Link]();
50 [Link]();
51 [Link]();
52 [Link]();
53 [Link]();
54
55 [Link]();
56 [Link]();
57 [Link]();
58 [Link]();
59 [Link]();
60 [Link]();
61 [Link]();
62 [Link]();
63 [Link]();
64 [Link]();
65 [Link]();
66 [Link]();
67 [Link]();
68 [Link]();
69 [Link]();

You might also like