File tree Expand file tree Collapse file tree 2 files changed +56
-0
lines changed
src/com/codefortomorrow/beginner/chapter4 Expand file tree Collapse file tree 2 files changed +56
-0
lines changed Original file line number Diff line number Diff line change
1
+ package com .codefortomorrow .beginner .chapter4 .practice ;
2
+
3
+ /**
4
+ * @author ArmeetJatyani
5
+ * March 2021
6
+ *
7
+ * Manage a car dealership and take inventory of all cars sold!
8
+ */
9
+
10
+ public class CarDealership {
11
+ public static void main (String [] args ) {
12
+ // write your code here
13
+
14
+ // define 3 integer constants, representing the prices of 3 cars sold in USD (line 15-17)
15
+
16
+
17
+
18
+
19
+ // define an integer variable, which represents the sum of the prices of these 3 cars (line 20)
20
+
21
+
22
+ // print out the formatted revenue after selling these 3 cars, output: "I sold 3 cars for $XXXXXX." (line 23)
23
+
24
+
25
+
26
+ }
27
+ }
28
+
Original file line number Diff line number Diff line change
1
+ package com .codefortomorrow .beginner .chapter4 .practice ;
2
+
3
+ /**
4
+ * @author ArmeetJatyani
5
+ * March 2021
6
+ *
7
+ * Manage a car dealership and take inventory of all cars sold!
8
+ */
9
+
10
+ public class CarDealership {
11
+ public static void main (String [] args ) {
12
+ // write your code here
13
+
14
+ // define 3 integer constants, representing the prices of 3 cars sold in USD (line 15-17)
15
+ final int car1 = 30000 ;
16
+ final int car2 = 24650 ;
17
+ final int car3 = 253630 ;
18
+
19
+ // define an integer variable, which represents the sum of the prices of these 3 cars (line 20)
20
+ int revenue = car1 + car2 + car3 ;
21
+
22
+ // print out the formatted revenue after selling these 3 cars, output: "I sold 3 cars for $XXXXXX." (line 23)
23
+ System .out .println ("I sold 3 cars for $" + revenue + "." );
24
+
25
+
26
+ }
27
+ }
28
+
You can’t perform that action at this time.
0 commit comments