a
This commit is contained in:
Generated
+8
@@ -0,0 +1,8 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
Generated
+6
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="19" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
||||
Generated
+8
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/EidP.iml" filepath="$PROJECT_DIR$/EidP.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
Generated
+6
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
Binary file not shown.
@@ -0,0 +1,13 @@
|
||||
import java.util.*;
|
||||
|
||||
class AdditionMitMatrNr{
|
||||
public static void main(String args[]){
|
||||
Scanner sc = new Scanner(System.in);
|
||||
final int martikel = 12345;
|
||||
int a = sc.nextInt();
|
||||
int b = sc.nextInt();
|
||||
int out= martikel + a + b;
|
||||
System.out.println(out);
|
||||
}
|
||||
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,12 @@
|
||||
import java.util.*;
|
||||
class Polynom{
|
||||
public static void main(String args[]){
|
||||
Scanner sc = new Scanner(System.in);
|
||||
int x = sc.nextInt();
|
||||
int mon1 = 5 * x;
|
||||
int mon2 = mon1 + 3 * x * x;
|
||||
mon1 = mon2 + x * x * x;
|
||||
System.out.println(mon1);
|
||||
sc.close();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
Binary file not shown.
@@ -0,0 +1,42 @@
|
||||
package Ueb03;
|
||||
|
||||
class zeichen{
|
||||
public static void main(String args[]){
|
||||
System.out.println("Hello World");
|
||||
System.out.print("Hello");//zusammen mit naechsten
|
||||
System.out.println(" World");
|
||||
System.out.println("4*5");//nicht berechnet
|
||||
System.out.println(4*5);//berechnet
|
||||
System.out.println("Dies ist" + "ein Text");
|
||||
System.out.println("Dies ist"
|
||||
+ "ein Text");//kein zeilenumbruch
|
||||
System.out.println("Dies ist ein \nText" );//Zeilenumbruch
|
||||
// Zeichen
|
||||
System.out.println("\u0065");//e
|
||||
System.out.println("");
|
||||
System.out.println("\"");// "
|
||||
// Ganze Zahlen
|
||||
System.out.println(2147483647);
|
||||
System.out.println(2147483647+1);//integer overflow
|
||||
System.out.println(0xFF);//in zahlen umgewandelt
|
||||
System.out.println(0xFFFF);
|
||||
System.out.println(0xFFFFFF);
|
||||
System.out.println(0xFFFFFFFF);
|
||||
System.out.println("0xFG");
|
||||
// Gleitpunktzahlen
|
||||
System.out.println("Zahl " + 0.344e-17f );
|
||||
System.out.println("Zahl " + 0.344e-17f );
|
||||
System.out.println("Zahl " + 0.12345678901234567890);//gerundet
|
||||
System.out.println("Zahl " + 0.12345678901234567890f);//frueher gerundet
|
||||
System.out.println("Summe " + (5.6 + 5.8) );//wrong
|
||||
System.out.println("Summe " + (12345678.0f + 0.1f) );//0.1 ignoriert
|
||||
System.out.println("Differenz " + (0.123456789f - 0.123456788f) );//0
|
||||
System.out.println("Summe " + ((12345678.0f + 0.1f) + 0.41f) );//anders als \/
|
||||
System.out.println("Summe " + (12345678.0f + (0.1f + 0.41f)) );
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,24 @@
|
||||
package Ueb04;
|
||||
|
||||
import java.util.*;
|
||||
class dose{
|
||||
public static void main(String args[]){
|
||||
double radius = Double.parseDouble(args[0]);
|
||||
double hoehe = Double.parseDouble(args[1]);
|
||||
final double pi = Math.PI;
|
||||
|
||||
double umfang = 2*pi*radius;
|
||||
double deckelflaeche = pi * radius * radius;
|
||||
double mantelflaeche = umfang * hoehe;
|
||||
double oberflaeche = 2*deckelflaeche + mantelflaeche;
|
||||
double volumen = deckelflaeche*hoehe;
|
||||
System.out.println("Umfang"+umfang+"deckelflaeche"+deckelflaeche+"mantelflaeche"+mantelflaeche+"oberflaeche"+oberflaeche+"volumen"+volumen
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package Ueb05;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
class Geldanlage{
|
||||
public static void main(String[] args){
|
||||
System.out.println("Jahre");
|
||||
Scanner sc = new Scanner(System.in);
|
||||
int jahre = sc.nextInt();
|
||||
System.out.println("Anlagebetrag");
|
||||
sc = new Scanner(System.in);
|
||||
double anlage = sc.nextDouble();
|
||||
|
||||
|
||||
|
||||
System.out.println("-------------------------------------------------------------------");
|
||||
System.out.println("1 1,5 % Verzinsung ohne Bonuszahlung");
|
||||
System.out.println("2 0,7 % Verzinsung mit 15 Euro Bonuszahlung");
|
||||
System.out.println("3 0,4 % Verzinsung mit 20 Euro Bonuszahlung");
|
||||
System.out.println("4 0,1 % Verzinsung mit 50 Euro Bonuszahlung");
|
||||
System.out.println("5 Fertig");
|
||||
System.out.println("--------------------------------------------------------------------");
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,59 @@
|
||||
package Ueb06;
|
||||
|
||||
class a4{
|
||||
static int counter,counter2;
|
||||
public static void main(String[] args){
|
||||
char[][] arrr = {{'*','a','*'},
|
||||
{'*',' '},
|
||||
{'B','c','0','a'}};
|
||||
char[][] arrrr = {{'*','a','*','a'},
|
||||
{'*','*','*','b'},
|
||||
{'B','c','0','c'}};
|
||||
berechneSterneProZeile(arrr);
|
||||
berechneSterneProSpalte(arrrr);
|
||||
berechneAnzahlZeilen(arrrr);
|
||||
}
|
||||
|
||||
public static void berechneSterneProZeile(char[][] arr){
|
||||
System.out.println("Zeilen");
|
||||
for(int i=0;i<arr.length;i++){
|
||||
counter = 0;
|
||||
|
||||
for (int j=0;j<arr[i].length;j++){
|
||||
if (arr[i][j] == '*')
|
||||
counter++;
|
||||
}
|
||||
System.out.println( i + ": " + counter);
|
||||
}
|
||||
}
|
||||
|
||||
public static void berechneSterneProSpalte(char[][] arr){
|
||||
System.out.println("Spalten");
|
||||
for( int i=0; i<arr[0].length; i++){
|
||||
counter = 0;
|
||||
for( int j=0; j<arr.length;j++){
|
||||
if(arr[j][i] == '*')
|
||||
counter++;
|
||||
}
|
||||
System.out.println( i + ": " + counter);
|
||||
|
||||
}
|
||||
}
|
||||
public static void berechneAnzahlZeilen(char[][] arr){
|
||||
counter2 = 0;
|
||||
for(int i=0;i<arr.length;i++){
|
||||
counter = 0;
|
||||
for (int j=0;j<arr[i].length;j++){
|
||||
if (arr[i][j] == '*')
|
||||
counter++;
|
||||
}
|
||||
if (counter >= 2)
|
||||
counter2++;
|
||||
}
|
||||
System.out.println("Anzahl" + counter2);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,58 @@
|
||||
package Ueb07;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
class Teileranzahl{
|
||||
static int in = 0, counter = 0, highest = 1,tmp;
|
||||
static Scanner sc;
|
||||
public static void main( String[] args){
|
||||
do{
|
||||
System.out.println("------------------------------------------------------------------------------");
|
||||
System.out.println("1 Teileranzahl für n");
|
||||
System.out.println("2 Maximale Teileranzahl für die Zahlen 1 bis n");
|
||||
System.out.println("3 Fertig");
|
||||
System.out.println("------------------------------------------------------------------------------");
|
||||
|
||||
sc = new Scanner(System.in);
|
||||
in = sc.nextInt();
|
||||
}while(!(in==1||in==2||in==3));
|
||||
switch(in){
|
||||
case 1:
|
||||
sc = new Scanner(System.in);
|
||||
in = sc.nextInt();
|
||||
|
||||
System.out.println(anzahlTeiler(in));
|
||||
break;
|
||||
case 2:
|
||||
sc = new Scanner(System.in);
|
||||
in = sc.nextInt();
|
||||
tmp = maxTeiler(in);
|
||||
System.out.println(tmp);
|
||||
System.out.println(anzahlTeiler(tmp));
|
||||
break;
|
||||
case 3:
|
||||
return;
|
||||
}
|
||||
sc.close();
|
||||
}
|
||||
|
||||
public static int anzahlTeiler(int input){
|
||||
counter = 0;
|
||||
for(int i=1; i<=in;i++){
|
||||
if(input%i==0){
|
||||
counter++;
|
||||
}
|
||||
}
|
||||
return counter;
|
||||
}
|
||||
|
||||
public static int maxTeiler(int input){
|
||||
for(int i=1;i<input;i++){
|
||||
if(anzahlTeiler(i) > anzahlTeiler(highest)){
|
||||
highest = i;
|
||||
}
|
||||
|
||||
}
|
||||
return highest;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package Ueb08;
|
||||
|
||||
public class Dozent {
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getLehrgebiet() {
|
||||
return lehrgebiet;
|
||||
}
|
||||
|
||||
public void setLehrgebiet(String lehrgebiet) {
|
||||
this.lehrgebiet = lehrgebiet;
|
||||
}
|
||||
|
||||
public boolean isDekan() {
|
||||
return dekan;
|
||||
}
|
||||
|
||||
public void setDekan(boolean dekan) {
|
||||
this.dekan = dekan;
|
||||
}
|
||||
|
||||
public char getGeschlecht() {
|
||||
return geschlecht;
|
||||
}
|
||||
|
||||
public void setGeschlecht(char geschlecht) {
|
||||
this.geschlecht = geschlecht;
|
||||
}
|
||||
|
||||
String name, lehrgebiet;
|
||||
boolean dekan=false;
|
||||
char geschlecht;
|
||||
|
||||
public Dozent(String pName, String pLehrgebiet, char pGeschlecht){
|
||||
name = pName;
|
||||
lehrgebiet = pLehrgebiet;
|
||||
geschlecht=pGeschlecht;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package Ueb08;
|
||||
|
||||
public class DozentTest {
|
||||
public static void main(String[] args) {
|
||||
Dozent dieDozentin = new Dozent("kek","gebiet",'w');
|
||||
Dozent derDekan = new Dozent("Dekan","dekanien",'m');
|
||||
derDekan.setDekan(true);
|
||||
System.out.println(derDekan.getGeschlecht() + derDekan.getName() + derDekan.getLehrgebiet() + derDekan.isDekan());
|
||||
System.out.println(dieDozentin.getLehrgebiet());
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,7 @@
|
||||
class hello{
|
||||
|
||||
public static void main (String args[]){
|
||||
System.out.println("Jordi Bolz");
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="19" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/EidP.iml" filepath="$PROJECT_DIR$/EidP.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
Binary file not shown.
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user