first commit
This commit is contained in:
7
Programmering/.vscode/settings.json
vendored
Normal file
7
Programmering/.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"java.project.sourcePaths": ["src"],
|
||||
"java.project.outputPath": "bin",
|
||||
"java.project.referencedLibraries": [
|
||||
"lib/**/*.jar"
|
||||
]
|
||||
}
|
||||
18
Programmering/README.md
Normal file
18
Programmering/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
Programmering/bin/App.class
Normal file
BIN
Programmering/bin/App.class
Normal file
Binary file not shown.
40
Programmering/src/App.java
Normal file
40
Programmering/src/App.java
Normal file
@@ -0,0 +1,40 @@
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
|
||||
public class App {
|
||||
public static void main(String[] args) {
|
||||
|
||||
}
|
||||
public static int sum() {
|
||||
int sum = 0;
|
||||
int isInputting = 1;
|
||||
System.out.println("Enter numbers to get sum. Enter blank to stop and get result");
|
||||
while (isInputting == 1) {
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
|
||||
try {
|
||||
int number = 1;
|
||||
int numberIndex = 1;
|
||||
String[] numberString = {"st","nd","rd","th","th","th","th","th","th","th",};
|
||||
if (number >= 10) {
|
||||
number = number - 10;
|
||||
if (numberIndex == 1) {
|
||||
numberIndex = 10;
|
||||
}
|
||||
else {
|
||||
numberIndex = numberIndex + 10;
|
||||
}
|
||||
System.out.println("Enter the " + number + numberString[number-1] + "number:");
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
return sum;
|
||||
}
|
||||
}
|
||||
|
||||
return sum;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user