forked from jean/GDP-Uebungen
files added
This commit is contained in:
Binary file not shown.
@@ -0,0 +1,21 @@
|
||||
public class Variablen{
|
||||
public static void main(String[]args){
|
||||
byte bVar1 = 5;
|
||||
short sVar1 = 400;
|
||||
int iVar1 = -35676;
|
||||
long lVar1 = 100000000L;
|
||||
float fVar1 = 0.123f;
|
||||
double dVar1 = 0.123;
|
||||
boolean istPrim1 = false;
|
||||
char cVar1 = 'x';
|
||||
System.out.println();
|
||||
System.out.println(bVar1);
|
||||
System.out.println(sVar1);
|
||||
System.out.println(iVar1);
|
||||
System.out.println(lVar1);
|
||||
System.out.println(fVar1);
|
||||
System.out.println(dVar1);
|
||||
System.out.println(cVar1);
|
||||
System.out.println(istPrim1);
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,21 @@
|
||||
public class Variablen{
|
||||
public static void main(String[]args){
|
||||
byte bVar1 = 5;
|
||||
short sVar1 = 400;
|
||||
int iVar1 = -35676;
|
||||
long lVar1 = 100000000L;
|
||||
float fVar1 = 0.123f;
|
||||
double dVar1 = 0.123;
|
||||
boolean istPrim1 = false;
|
||||
char cVar1 = 'x';
|
||||
System.out.println();
|
||||
System.out.println(bVar1);
|
||||
System.out.println(sVar1);
|
||||
System.out.println(iVar1);
|
||||
System.out.println(lVar1);
|
||||
System.out.println(fVar1);
|
||||
System.out.println(dVar1);
|
||||
System.out.println(cVar1);
|
||||
System.out.println(istPrim1);
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,17 @@
|
||||
public class Verdienstrechner{
|
||||
public static void main(String[] args){
|
||||
float stunden = 7;
|
||||
float stundenlohn = 12.0f;
|
||||
float verdienst = stunden*stundenlohn;
|
||||
|
||||
System.out.print("Stundenlohn: ");
|
||||
System.out.println(stundenlohn);
|
||||
|
||||
System.out.println("Stundenlohn: " + stundenlohn);
|
||||
|
||||
System.out.println("Stunden insgesamt: " + stunden);
|
||||
|
||||
System.out.println("Ich habe " + verdienst + " verdient.");
|
||||
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,35 @@
|
||||
import java.util.Scanner;
|
||||
|
||||
public class Verdienstrechner {
|
||||
public static void main(String[] args) {
|
||||
float stunden = 9f;
|
||||
float stundenlohn = 12.0f;
|
||||
float ueStundenlohn = 17.5f;
|
||||
float ueStunden = 0;
|
||||
float regArbeitszeit = 8;
|
||||
Scanner scan = new Scanner(System.in);
|
||||
System.out.print("Standardwerte verwenden? [J/n]: ");
|
||||
if (scan.nextLine().equalsIgnoreCase("n")) {
|
||||
System.out.print("\nDeine regulaere Arbeitszeit: ");
|
||||
regArbeitszeit = scan.nextFloat();
|
||||
System.out.print("\nWie viel verdienst du in der Stunde?: ");
|
||||
stundenlohn = scan.nextFloat();
|
||||
System.out.print("\n Wie viel Stunden hast du gearbeitet?: ");
|
||||
stunden = scan.nextFloat();
|
||||
System.out.print("\n Wie viel verdienst du bei Überstunden?:");
|
||||
ueStundenlohn = scan.nextFloat();
|
||||
}
|
||||
System.out.println("------ BERECHNE-------\n");
|
||||
System.out.println("Stundenlohn: " + stundenlohn);
|
||||
System.out.println("Stunden insgesamt: " + stunden);
|
||||
if (stunden > regArbeitszeit) {
|
||||
ueStunden = stunden - regArbeitszeit;
|
||||
System.out.println("Ueberstunden: " + ueStunden);
|
||||
stunden = 8;
|
||||
}
|
||||
float verdienst = stunden * stundenlohn + ueStundenlohn * ueStunden;
|
||||
|
||||
System.out.println("Ich habe " + verdienst + " verdient.");
|
||||
scan.close();
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Reference in New Issue
Block a user