changed the file structure
This commit is contained in:
parent
b1c3582880
commit
6b23a757b6
70 changed files with 764 additions and 23 deletions
7
Code/Steiner/oopPruefung1/.vscode/settings.json
vendored
Normal file
7
Code/Steiner/oopPruefung1/.vscode/settings.json
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"java.project.sourcePaths": ["src"],
|
||||
"java.project.outputPath": "bin",
|
||||
"java.project.referencedLibraries": [
|
||||
"lib/**/*.jar"
|
||||
]
|
||||
}
|
18
Code/Steiner/oopPruefung1/README.md
Normal file
18
Code/Steiner/oopPruefung1/README.md
Normal file
|
@ -0,0 +1,18 @@
|
|||
## Getting Started
|
||||
|
||||
Welcome to the VS Code Java world. Here is a guideline to help you get started to write Java code in Visual Studio Code.
|
||||
|
||||
## Folder Structure
|
||||
|
||||
The workspace contains two folders by default, where:
|
||||
|
||||
- `src`: the folder to maintain sources
|
||||
- `lib`: the folder to maintain dependencies
|
||||
|
||||
Meanwhile, the compiled output files will be generated in the `bin` folder by default.
|
||||
|
||||
> If you want to customize the folder structure, open `.vscode/settings.json` and update the related settings there.
|
||||
|
||||
## Dependency Management
|
||||
|
||||
The `JAVA PROJECTS` view allows you to manage your dependencies. More details can be found [here](https://github.com/microsoft/vscode-java-dependency#manage-dependencies).
|
BIN
Code/Steiner/oopPruefung1/bin/App.class
Normal file
BIN
Code/Steiner/oopPruefung1/bin/App.class
Normal file
Binary file not shown.
BIN
Code/Steiner/oopPruefung1/bin/Time.class
Normal file
BIN
Code/Steiner/oopPruefung1/bin/Time.class
Normal file
Binary file not shown.
BIN
Code/Steiner/oopPruefung1/src/App.class
Normal file
BIN
Code/Steiner/oopPruefung1/src/App.class
Normal file
Binary file not shown.
16
Code/Steiner/oopPruefung1/src/App.java
Normal file
16
Code/Steiner/oopPruefung1/src/App.java
Normal file
|
@ -0,0 +1,16 @@
|
|||
// Luca Burger
|
||||
// Aufgabe 12
|
||||
|
||||
public class App {
|
||||
public static void main(String[] args) throws Exception {
|
||||
Time myTime1 = new Time(5, 42);
|
||||
Time myTime2 = new Time(3, 27);
|
||||
Time myTime3 = new Time(5, 20);
|
||||
Time myTime4 = new Time(3, 10);
|
||||
Time myTime5 = new Time(3, 20);
|
||||
|
||||
System.out.println(Time.subtract(myTime3, myTime4));
|
||||
System.out.println(Time.convertToMinute(myTime1));
|
||||
|
||||
}
|
||||
}
|
BIN
Code/Steiner/oopPruefung1/src/Time.class
Normal file
BIN
Code/Steiner/oopPruefung1/src/Time.class
Normal file
Binary file not shown.
37
Code/Steiner/oopPruefung1/src/Time.java
Normal file
37
Code/Steiner/oopPruefung1/src/Time.java
Normal file
|
@ -0,0 +1,37 @@
|
|||
// Luca Burger
|
||||
// Aufgabe 12
|
||||
|
||||
public class Time {
|
||||
int hour;
|
||||
int minute;
|
||||
|
||||
Time(int hour, int minute) {
|
||||
this.hour = hour;
|
||||
this.minute = minute;
|
||||
}
|
||||
|
||||
void add(Time time, Time time2) {
|
||||
time.hour += time2.hour;
|
||||
time.minute += time2.minute;
|
||||
}
|
||||
|
||||
static int subtract(Time time, Time time2) {
|
||||
int minute1 = convertToMinute(time);
|
||||
int minute2 = convertToMinute(time2);
|
||||
return minute1 - minute2;
|
||||
|
||||
}
|
||||
|
||||
static int convertToMinute(Time time) {
|
||||
int add = time.hour * 60;
|
||||
return time.minute += add;
|
||||
}
|
||||
|
||||
static String print(Time myTime) {
|
||||
String text = "";
|
||||
text += myTime.hour;
|
||||
text += ":";
|
||||
text += myTime.minute;
|
||||
return text;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue