File tree Expand file tree Collapse file tree 2 files changed +66
-0
lines changed
samueledward/Question 2.0 Expand file tree Collapse file tree 2 files changed +66
-0
lines changed Original file line number Diff line number Diff line change
1
+ //Compute the square and cubes
2
+ package classes ;
3
+
4
+ /**
5
+ *
6
+ * @author Samuel Edward
7
+ */
8
+ public class Square_and_Cubes {
9
+ public static void main (String args []) {
10
+
11
+ //Block for displaying the numbers itself
12
+ System .out .print ("The numbers are : " );
13
+ for (int i =1 ; i <=10 ; i ++){
14
+ System .out .print ( i );
15
+ if (i < 10 ) {
16
+ System .out .print ("," );
17
+ }else {
18
+ System .out .println ("." );
19
+ }
20
+ }
21
+ //Block for displaying the square of those numbers
22
+ System .out .print ("The numbers for the square are : " );
23
+ for (int i =1 ; i <=10 ; i ++){
24
+ System .out .print ( i *i );
25
+ if (i < 10 ) {
26
+ System .out .print ("," );
27
+ }else {
28
+ System .out .println ("." );
29
+ }
30
+ }
31
+
32
+ //Block for displaying the cube of those numbers
33
+ System .out .print ("The numbers for the cube are : " );
34
+ for (int i =1 ; i <=10 ; i ++){
35
+ System .out .print ( i *i *i );
36
+ if (i < 10 ) {
37
+ System .out .print ("," );
38
+ }else {
39
+ System .out .print ("." );
40
+ }
41
+ }
42
+
43
+
44
+ }
45
+ }
Original file line number Diff line number Diff line change
1
+
2
+ package classes ;
3
+
4
+ /**
5
+ *
6
+ * @author Samuel Edward
7
+ */
8
+ public class TOD {
9
+ public static void main (String args []) {
10
+
11
+ //Printing TOD
12
+ System .out .println (" *********** * *" );
13
+ System .out .println (" * * * * *" );
14
+ System .out .println (" * * * * *" );
15
+ System .out .println (" * * * * *" );
16
+ System .out .println (" * * * * *" );
17
+ System .out .println (" * * * * * *" );
18
+
19
+
20
+ }
21
+ }
You can’t perform that action at this time.
0 commit comments