Commit 8a35d15
committed
feat: Add Expression class to calculate area of a triangle using user input
Add a program that:
- Takes base and height as floating-point inputs from the user
- Calculates the area using the formula (base × height) / 2
- Outputs the computed area
- Demonstrates the use of arithmetic expressions and `Scanner` class for input.1 parent 4ab745b commit 8a35d15
1 file changed
+4
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
| 5 | + | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
11 | | - | |
12 | | - | |
| 10 | + | |
| 11 | + | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
20 | | - | |
| 19 | + | |
0 commit comments