Aufgaben AB Auswahlstrukturen hinzugefügt

This commit is contained in:
Joel Baldauf
2020-11-24 16:02:02 +01:00
parent bc99c7b9ff
commit 3502af836a
10 changed files with 263 additions and 0 deletions
@@ -0,0 +1,20 @@
import java.util.Scanner;
public class Rabattsystem {
public static void main(String[] args) {
Scanner tastatur = new Scanner(System.in);
System.out.print("Bestellwert:");
double bestellwert = tastatur.nextDouble();
if (bestellwert<=100) {
bestellwert = 0.9 * bestellwert;
}
else if (bestellwert > 100 && bestellwert < 500) {
bestellwert = 0.85 * bestellwert;
}
else {
bestellwert = bestellwert - (0.2 * bestellwert);
}
bestellwert = 1.19 * bestellwert;
System.out.print("ermäßigter Bestellwert (incl. MwSt.): " + bestellwert);
}
}