initial commit
This commit is contained in:
@@ -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.
@@ -0,0 +1,21 @@
|
||||
// Écrire un programme demandant à l’utilisateur de saisir deux valeurs numériques b et n (vérifier que n est positif) et affichant la valeur bn.
|
||||
|
||||
import java.util.Scanner;
|
||||
|
||||
public class App {
|
||||
public static void main(String[] args) throws Exception {
|
||||
|
||||
Scanner sc = new Scanner(System.in);
|
||||
System.out.print("Entrez le premier chiffre que vous voulez (b) : ");
|
||||
int b = sc.nextInt();
|
||||
|
||||
int n;
|
||||
do{
|
||||
System.out.print("Entrez le second chiffre que vous voulez (n), il doit être positif : ");
|
||||
n = sc.nextInt();
|
||||
// Vérification à effectuer pour savoir si "n" est positif, sinon on repart au "do"
|
||||
} while (n < 0);
|
||||
|
||||
System.out.println(b + " * " + n + " = " + b*n);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user