first upload

This commit is contained in:
DH10RBH 2024-04-10 10:16:18 +02:00
commit 905120447f
37 changed files with 409 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
IntelliJ IDEA 2023.2.5.lnk Normal file

Binary file not shown.

View File

@ -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

View File

@ -0,0 +1,5 @@
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="21" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/Objektorientierung.iml" filepath="$PROJECT_DIR$/Objektorientierung.iml" />
</modules>
</component>
</project>

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

View File

@ -0,0 +1,21 @@
class Angestellter extends Mitarbeiter{
double monatsGehalt;
Angestellter(int personalNummer, String name, String vorname, double monatsGehalt){
this.personalNummer = personalNummer;
this.name = name;
this.vorname = vorname;
this.monatsGehalt = monatsGehalt;
}
void print(){
System.out.println(getPersonalNummer());
System.out.println(getName());
System.out.println(getVorname());
System.out.println(monatsGehalt);
}
}

View File

@ -0,0 +1,21 @@
import org.w3c.dom.ls.LSOutput;
import javax.sound.midi.Soundbank;
import java.awt.*;
public class Anwendung {
Arbeiter Frank = new Arbeiter(4711, "Meier", "Frank", 14.67);
Facharbeiter Steffi_Mueller = new Facharbeiter (4712,"Müller", "Steffi",18.33, "Chemie");
Manager Karl_Heinz_Kaiser = new Manager (3, "Kaiser", "Karls-Heinz", 5000, 2.50, "Mazda Cabrio", "S-ZZ 999");
Anwendung(){
Frank.print();
System.out.println("====================");
Steffi_Mueller.print();
System.out.println("====================");
Karl_Heinz_Kaiser.print();
}
}

View File

@ -0,0 +1,20 @@
class Arbeiter extends Mitarbeiter{
double stundensatz;
Arbeiter(int personalNummer, String name, String vorname, double stundensatz){
this.personalNummer = personalNummer;
this.name = name;
this.vorname = vorname;
this.stundensatz = stundensatz;
}
void print(){
System.out.println(getPersonalNummer());
System.out.println(getName());
System.out.println(getVorname());
System.out.println(stundensatz);
}
}

View File

@ -0,0 +1,19 @@
final class Facharbeiter extends Arbeiter{
String fachRichtung;
Facharbeiter(int personalNummer, String name, String vorname, double stundensatz, String fachRichtung){
super(personalNummer, name, vorname, stundensatz);
this.fachRichtung = fachRichtung;
}
void print(){
System.out.println(getPersonalNummer());
System.out.println(getName());
System.out.println(getVorname());
System.out.println(stundensatz);
System.out.println(fachRichtung);
}
}

View File

@ -0,0 +1,5 @@
public class Main {
public static void main(String[] args){
Anwendung temp = new Anwendung();
}
}

View File

@ -0,0 +1,30 @@
class Manager extends leitenderAngestellter{
String wagentyp;
String kennzeichen;
Manager(int personalNummer, String name, String vorname, double monatsGehalt, double bonus, String wagentyp, String kennzeichen) {
super(personalNummer, name, vorname, monatsGehalt);
this.bonus = bonus;
this.wagentyp = wagentyp;
this.kennzeichen = kennzeichen;
}
void setWagentyp(String y){wagentyp = y;}
void setKennzeichen(String y){kennzeichen = y;}
String getWagentyp(){return wagentyp;}
String getKennzeichen(){return kennzeichen;}
void print() {
System.out.println(getPersonalNummer());
System.out.println(getName());
System.out.println(getVorname());
System.out.println(monatsGehalt);
System.out.println(bonus);
System.out.println(getWagentyp());
System.out.println(getKennzeichen());
}
}

View File

@ -0,0 +1,14 @@
abstract class Mitarbeiter{
int personalNummer;
String name;
String vorname;
abstract void print();
void setPersonalNummer(int i){personalNummer=i;}
void setName(String s){name=s;}
void setVorname(String s){vorname=s;}
int getPersonalNummer(){return personalNummer;}
String getName(){return name;}
String getVorname(){return vorname;}
}

View File

@ -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>

View File

@ -0,0 +1,16 @@
class leitenderAngestellter extends Angestellter {
double bonus;
leitenderAngestellter(int personalNummer, String name, String vorname, double monatsGehalt) {
super(personalNummer, name, vorname, monatsGehalt);
this.bonus = bonus;
}
void print() {
System.out.println(getPersonalNummer());
System.out.println(getName());
System.out.println(getVorname());
System.out.println(monatsGehalt);
System.out.println(bonus);
}
}

View File

@ -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

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="21" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/Objektorientierung.iml" filepath="$PROJECT_DIR$/Objektorientierung.iml" />
</modules>
</component>
</project>

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

View File

@ -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.

After

Width:  |  Height:  |  Size: 44 KiB

29
Objektorientierung III, afg3/.gitignore vendored Normal file
View File

@ -0,0 +1,29 @@
### IntelliJ IDEA ###
out/
!**/src/main/**/out/
!**/src/test/**/out/
### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
### VS Code ###
.vscode/
### Mac OS ###
.DS_Store

View File

@ -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

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="21" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/untitled.iml" filepath="$PROJECT_DIR$/untitled.iml" />
</modules>
</component>
</project>

View File

@ -0,0 +1,30 @@
public class Main {
public static void main(String[] args) {
Matrix m1 = new Matrix(2, 3);
m1.setData(0, 0, 1);
m1.setData(0, 1, 2);
m1.setData(0, 2, 3);
m1.setData(1, 0, 4);
m1.setData(1, 1, 5);
m1.setData(1, 2, 6);
Matrix m2 = new Matrix(2, 3);
m2.setData(0, 0, 7);
m2.setData(0, 1, 8);
m2.setData(0, 2, 9);
m2.setData(1, 0, 10);
m2.setData(1, 1, 11);
m2.setData(1, 2, 12);
m1.print(); // Output: 1.0 2.0 3.0
// 4.0 5.0 6.0
m1.scalarMultiply(2);
m1.print(); // Output: 2.0 4.0 6.0
// 8.0 10.0 12.0
m1.add(m2);
m1.print(); // Output: 9.0 12.0 15.0
// 18.0 21.0 24.0
}
}

View File

@ -0,0 +1,48 @@
public class Matrix {
private int rows;
private int cols;
private double[][] data;
public Matrix(int rows, int cols) {
this.rows = rows;
this.cols = cols;
data = new double[rows][cols];
}
public double getData(int row, int col) {
return data[row][col];
}
public void setData(int row, int col, double value) {
data[row][col] = value;
}
public void scalarMultiply(double scalar) {
for (int i = 0; i < rows; i++) {
for (int j = 0; j < cols; j++) {
data[i][j] *= scalar;
}
}
}
public void add(Matrix matrix) {
if (rows == matrix.rows && cols == matrix.cols) {
for (int i = 0; i < rows; i++) {
for (int j = 0; j < cols; j++) {
data[i][j] += matrix.data[i][j];
}
}
} else {
throw new IllegalArgumentException("The matrices have different dimensions.");
}
}
public void print() {
for (int i = 0; i < rows; i++) {
for (int j = 0; j < cols; j++) {
System.out.print(data[i][j] + " ");
}
System.out.println();
}
}
}

View File

@ -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$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AutoImportSettings">
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="c15bb437-814c-4e9c-a95e-808f2fbaf4d0" name="Changes" comment="" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="Class" />
</list>
</option>
</component>
<component name="ProjectColorInfo">{
&quot;associatedIndex&quot;: 8
}</component>
<component name="ProjectId" id="2eaXOdPgeVOMpJi3jqwUn7dO7kg" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">{
&quot;keyToString&quot;: {
&quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
&quot;WebServerToolWindowFactoryState&quot;: &quot;false&quot;,
&quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
&quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
&quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
&quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
&quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
}
}</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="c15bb437-814c-4e9c-a95e-808f2fbaf4d0" name="Changes" comment="" />
<created>1712143633808</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1712143633808</updated>
<workItem from="1712143634817" duration="130000" />
<workItem from="1712143786441" duration="777000" />
<workItem from="1712735802871" duration="251000" />
<workItem from="1712736064997" duration="25000" />
</task>
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="3" />
</component>
</project>