forked from code4tomorrow/java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApplesOranges.java
More file actions
28 lines (20 loc) · 840 Bytes
/
ApplesOranges.java
File metadata and controls
28 lines (20 loc) · 840 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package com.codefortomorrow.beginner.chapter2.solutions;
/**
* @author ArmeetJatyani
* March 2021
*
* Print out the number of apples and oranges!
*/
public class ApplesOranges {
public static void main(String[] args) {
// write your code here
// define an integer variable called numOranges with value 10 (line 15)
int numOranges = 10;
// define an integer variable called numApples with value 24 (line 18)
int numApples = 24;
// print out number of oranges using variables, output: "I have 10 oranges." (line 21)
System.out.println("I have " + numOranges + " oranges.");
// print out number of apples using variables, output: "I have 24 apples." (line 24)
System.out.println("I have " + numApples + " apples.");
}
}