mirror of
https://github.com/Cametendo/cflash.git
synced 2026-03-18 04:50:19 +01:00
create base
This commit is contained in:
6
Greeting.java
Normal file
6
Greeting.java
Normal file
@@ -0,0 +1,6 @@
|
||||
public class Greeting {
|
||||
public void greeting() {
|
||||
System.out.println("Welcome to cflash!");
|
||||
System.out.println("Would you like to flash an image (Y/n)");
|
||||
}
|
||||
}
|
||||
19
Main.java
Normal file
19
Main.java
Normal file
@@ -0,0 +1,19 @@
|
||||
import java.util.Scanner;
|
||||
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
Scanner UserInput = new Scanner(System.in);
|
||||
|
||||
greeting();
|
||||
String input = UserInput.nextLine();
|
||||
|
||||
if (YesNo.check(input)) {
|
||||
System.out.println("Please choose a device");
|
||||
} else {
|
||||
System.out.println("Canceling...");
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
16
YesNo.java
Normal file
16
YesNo.java
Normal file
@@ -0,0 +1,16 @@
|
||||
public class YesNo {
|
||||
public static boolean check(String input) {
|
||||
switch (input) {
|
||||
case "Y":
|
||||
return true;
|
||||
case "y":
|
||||
return true;
|
||||
case "":
|
||||
return true;
|
||||
case "n":
|
||||
return false;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user