first upload
This commit is contained in:
commit
905120447f
BIN
Dokumentation und Programmierstil/2).png
Normal file
BIN
Dokumentation und Programmierstil/2).png
Normal file
Binary file not shown.
After Width: | Height: | Size: 50 KiB |
BIN
IntelliJ IDEA 2023.2.5.lnk
Normal file
BIN
IntelliJ IDEA 2023.2.5.lnk
Normal file
Binary file not shown.
8
Objektorientierung I, afg1/.idea/.gitignore
generated
vendored
Normal file
8
Objektorientierung I, afg1/.idea/.gitignore
generated
vendored
Normal 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
|
5
Objektorientierung I, afg1/.idea/misc.xml
generated
Normal file
5
Objektorientierung I, afg1/.idea/misc.xml
generated
Normal 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>
|
8
Objektorientierung I, afg1/.idea/modules.xml
generated
Normal file
8
Objektorientierung I, afg1/.idea/modules.xml
generated
Normal 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>
|
BIN
Objektorientierung I, afg1/1b).png
Normal file
BIN
Objektorientierung I, afg1/1b).png
Normal file
Binary file not shown.
After Width: | Height: | Size: 37 KiB |
21
Objektorientierung I, afg1/Angestellter.java
Normal file
21
Objektorientierung I, afg1/Angestellter.java
Normal 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);
|
||||
}
|
||||
|
||||
|
||||
}
|
21
Objektorientierung I, afg1/Anwendung.java
Normal file
21
Objektorientierung I, afg1/Anwendung.java
Normal 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();
|
||||
}
|
||||
}
|
||||
|
20
Objektorientierung I, afg1/Arbeiter.java
Normal file
20
Objektorientierung I, afg1/Arbeiter.java
Normal 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);
|
||||
}
|
||||
|
||||
}
|
19
Objektorientierung I, afg1/Facharbeiter.java
Normal file
19
Objektorientierung I, afg1/Facharbeiter.java
Normal 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);
|
||||
}
|
||||
|
||||
}
|
5
Objektorientierung I, afg1/Main.java
Normal file
5
Objektorientierung I, afg1/Main.java
Normal file
@ -0,0 +1,5 @@
|
||||
public class Main {
|
||||
public static void main(String[] args){
|
||||
Anwendung temp = new Anwendung();
|
||||
}
|
||||
}
|
30
Objektorientierung I, afg1/Manager.java
Normal file
30
Objektorientierung I, afg1/Manager.java
Normal 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());
|
||||
}
|
||||
}
|
14
Objektorientierung I, afg1/Mitarbeiter.java
Normal file
14
Objektorientierung I, afg1/Mitarbeiter.java
Normal 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;}
|
||||
}
|
11
Objektorientierung I, afg1/Objektorientierung.iml
Normal file
11
Objektorientierung I, afg1/Objektorientierung.iml
Normal 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>
|
16
Objektorientierung I, afg1/leitenderAngestellter.java
Normal file
16
Objektorientierung I, afg1/leitenderAngestellter.java
Normal 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);
|
||||
}
|
||||
}
|
8
Objektorientierung I, afg1/out/production/Objektorientierung/.idea/.gitignore
generated
vendored
Normal file
8
Objektorientierung I, afg1/out/production/Objektorientierung/.idea/.gitignore
generated
vendored
Normal 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
|
6
Objektorientierung I, afg1/out/production/Objektorientierung/.idea/misc.xml
generated
Normal file
6
Objektorientierung I, afg1/out/production/Objektorientierung/.idea/misc.xml
generated
Normal 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>
|
8
Objektorientierung I, afg1/out/production/Objektorientierung/.idea/modules.xml
generated
Normal file
8
Objektorientierung I, afg1/out/production/Objektorientierung/.idea/modules.xml
generated
Normal 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 |
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.
@ -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.
BIN
Objektorientierung II, afg2/2).png
Normal file
BIN
Objektorientierung II, afg2/2).png
Normal file
Binary file not shown.
After Width: | Height: | Size: 44 KiB |
29
Objektorientierung III, afg3/.gitignore
vendored
Normal file
29
Objektorientierung III, afg3/.gitignore
vendored
Normal 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
|
8
Objektorientierung III, afg3/.idea/.gitignore
generated
vendored
Normal file
8
Objektorientierung III, afg3/.idea/.gitignore
generated
vendored
Normal 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
|
6
Objektorientierung III, afg3/.idea/misc.xml
generated
Normal file
6
Objektorientierung III, afg3/.idea/misc.xml
generated
Normal 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>
|
8
Objektorientierung III, afg3/.idea/modules.xml
generated
Normal file
8
Objektorientierung III, afg3/.idea/modules.xml
generated
Normal 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>
|
30
Objektorientierung III, afg3/src/Main.java
Normal file
30
Objektorientierung III, afg3/src/Main.java
Normal 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
|
||||
}
|
||||
}
|
48
Objektorientierung III, afg3/src/Matrix.java
Normal file
48
Objektorientierung III, afg3/src/Matrix.java
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
11
Objektorientierung III, afg3/untitled.iml
Normal file
11
Objektorientierung III, afg3/untitled.iml
Normal 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>
|
58
untitled/.idea/workspace.xml
generated
Normal file
58
untitled/.idea/workspace.xml
generated
Normal 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">{
|
||||
"associatedIndex": 8
|
||||
}</component>
|
||||
<component name="ProjectId" id="2eaXOdPgeVOMpJi3jqwUn7dO7kg" />
|
||||
<component name="ProjectViewState">
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent">{
|
||||
"keyToString": {
|
||||
"RunOnceActivity.OpenProjectViewOnStart": "true",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"WebServerToolWindowFactoryState": "false",
|
||||
"node.js.detected.package.eslint": "true",
|
||||
"node.js.detected.package.tslint": "true",
|
||||
"node.js.selected.package.eslint": "(autodetect)",
|
||||
"node.js.selected.package.tslint": "(autodetect)",
|
||||
"vue.rearranger.settings.migration": "true"
|
||||
}
|
||||
}</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>
|
Loading…
Reference in New Issue
Block a user