Skip to content

Commit 9540d07

Browse files
committed
implement solution
1 parent 8e55ee8 commit 9540d07

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

Exercise.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
1+
import java.util.Scanner;
2+
13
public class Exercise {
24

35
public static void main(String[] args) {
4-
// implement exercise here
6+
@SuppressWarnings("resource")
7+
Scanner sc = new Scanner(System.in);
8+
9+
System.out.print("Gib bitte eine ganze Zahl ein: ");
10+
int a = sc.nextInt();
11+
12+
System.out.print("Gib bitte eine weitere ganze Zahl ein: ");
13+
int b = sc.nextInt();
14+
15+
double c = (a * 100.0) / b;
16+
17+
System.out.println("Ergebnis: " + a + " von " + b + " sind " + c + "%");
518
}
619
}

0 commit comments

Comments
 (0)