changed the file structure

This commit is contained in:
Sage The DM 2024-10-22 09:33:26 +02:00
parent b1c3582880
commit 6b23a757b6
70 changed files with 764 additions and 23 deletions

View file

@ -0,0 +1,7 @@
{
"java.project.sourcePaths": ["src"],
"java.project.outputPath": "bin",
"java.project.referencedLibraries": [
"lib/**/*.jar"
]
}

View 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).

Binary file not shown.

Binary file not shown.

Binary file not shown.

View 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));
}
}

Binary file not shown.

View 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;
}
}