Skip to content

Commit b9f1238

Browse files
committed
ApplesOranges exercise complete
1 parent a2a2eb8 commit b9f1238

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package com.codefortomorrow.beginner.chapter2.practice;
2+
3+
/**
4+
* @author ArmeetJatyani
5+
* March 2021
6+
*
7+
* Print out the number of apples and oranges!
8+
*/
9+
10+
public class ApplesOranges {
11+
public static void main(String[] args) {
12+
// write your code here
13+
14+
// define an integer variable called numOranges with value 10 (line 15)
15+
16+
17+
// define an integer variable called numApples with value 24 (line 18)
18+
19+
20+
// print out number of oranges, output: "I have 10 oranges." (line 21)
21+
22+
23+
// print out number of apples, output: "I have 24 apples." (line 24)
24+
25+
26+
}
27+
}
28+
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package com.codefortomorrow.beginner.chapter2.practice;
2+
3+
/**
4+
* @author ArmeetJatyani
5+
* March 2021
6+
*
7+
* Print out the number of apples and oranges!
8+
*/
9+
10+
public class ApplesOranges {
11+
public static void main(String[] args) {
12+
// write your code here
13+
14+
// define an integer variable called numOranges with value 10 (line 15)
15+
int numOranges = 10;
16+
17+
// define an integer variable called numApples with value 24 (line 18)
18+
int numApples = 24;
19+
20+
// print out number of oranges, output: "I have 10 oranges." (line 21)
21+
System.out.println("I have " + numOranges + " oranges.");
22+
23+
// print out number of apples, output: "I have 24 apples." (line 24)
24+
System.out.println("I have " + numApples + " apples.");
25+
26+
}
27+
}
28+

0 commit comments

Comments
 (0)