changed the file structure
This commit is contained in:
parent
cd81159162
commit
b1c3582880
391 changed files with 675 additions and 0 deletions
7
Code/Steiner/oppUebung4/.vscode/settings.json
vendored
Normal file
7
Code/Steiner/oppUebung4/.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/oppUebung4/README.md
Normal file
18
Code/Steiner/oppUebung4/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/oppUebung4/bin/App.class
Normal file
BIN
Code/Steiner/oppUebung4/bin/App.class
Normal file
Binary file not shown.
BIN
Code/Steiner/oppUebung4/bin/Storage.class
Normal file
BIN
Code/Steiner/oppUebung4/bin/Storage.class
Normal file
Binary file not shown.
BIN
Code/Steiner/oppUebung4/bin/Unit.class
Normal file
BIN
Code/Steiner/oppUebung4/bin/Unit.class
Normal file
Binary file not shown.
BIN
Code/Steiner/oppUebung4/src/App.class
Normal file
BIN
Code/Steiner/oppUebung4/src/App.class
Normal file
Binary file not shown.
51
Code/Steiner/oppUebung4/src/App.java
Normal file
51
Code/Steiner/oppUebung4/src/App.java
Normal file
|
@ -0,0 +1,51 @@
|
|||
public class App {
|
||||
public static void main(String[] args) throws Exception {
|
||||
Object[][] article = {
|
||||
{ 1, "Banana", 5, "Stk" },
|
||||
{ 23, "Flour", 2, "KG" },
|
||||
{ 12, "Milk", 4, "Liters" },
|
||||
{ 34, "Apple", 10, "Stk" },
|
||||
{ 45, "Sugar", 1, "KG" },
|
||||
{ 67, "Eggs", 12, "Stk" },
|
||||
{ 89, "Rice", 5, "KG" },
|
||||
{ 21, "Butter", 2, "Packs" },
|
||||
{ 78, "Orange Juice", 3, "Liters" },
|
||||
{ 56, "Bread", 2, "Loaves" },
|
||||
{ 90, "Cheese", 1, "KG" },
|
||||
{ 32, "Tomato", 8, "Stk" },
|
||||
{ 11, "Salt", 1, "KG" }
|
||||
|
||||
};
|
||||
|
||||
// Create an array to hold Storage objects
|
||||
Storage[] myStorage = new Storage[article.length];
|
||||
|
||||
// Create and store Storage objects in the array
|
||||
for (int i = 0; i < article.length; i++) {
|
||||
myStorage[i] = createStorage(article[i]);
|
||||
}
|
||||
|
||||
// Print out the details of each Item
|
||||
for (Storage storage : myStorage) {
|
||||
printItems(storage);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static Storage createStorage(Object[] article) {
|
||||
Storage storage = new Storage();
|
||||
storage.storageId = (int) article[0];
|
||||
storage.name = (String) article[1];
|
||||
storage.unit.quantaty = (int) article[2];
|
||||
storage.unit.unit = (String) article[3];
|
||||
return storage;
|
||||
}
|
||||
|
||||
private static void printItems(Storage storage) {
|
||||
System.out.println("Item on shelf: " + storage.storageId);
|
||||
System.out.println("Item name: " + storage.name);
|
||||
System.out.println("Item(s) on stock: " + storage.unit.quantaty);
|
||||
System.out.println("Measured unit: " + storage.unit.unit);
|
||||
System.out.println("-----------------------------------------");
|
||||
}
|
||||
}
|
BIN
Code/Steiner/oppUebung4/src/Storage.class
Normal file
BIN
Code/Steiner/oppUebung4/src/Storage.class
Normal file
Binary file not shown.
5
Code/Steiner/oppUebung4/src/Storage.java
Normal file
5
Code/Steiner/oppUebung4/src/Storage.java
Normal file
|
@ -0,0 +1,5 @@
|
|||
public class Storage {
|
||||
int storageId;
|
||||
String name;
|
||||
Unit unit = new Unit();
|
||||
}
|
BIN
Code/Steiner/oppUebung4/src/Unit.class
Normal file
BIN
Code/Steiner/oppUebung4/src/Unit.class
Normal file
Binary file not shown.
4
Code/Steiner/oppUebung4/src/Unit.java
Normal file
4
Code/Steiner/oppUebung4/src/Unit.java
Normal file
|
@ -0,0 +1,4 @@
|
|||
public class Unit {
|
||||
int quantaty;
|
||||
String unit;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue