create base

This commit is contained in:
Cametendo
2026-02-09 08:26:01 +01:00
parent 73ce756cbc
commit baab63f846
3 changed files with 41 additions and 0 deletions

6
Greeting.java Normal file
View 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
View 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
View 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;
}
}
}