Duo Collab

12345678910111213141516171819202122232425262728293031323334
  1. import java.util.Scanner;
  2. public class Console{
  3. public static void print(String output, Object... args) {
  4. System.out.printf(output, args);
  5. }
  6. public static void println(String output, Object... args) {
  7. print(output + "\n", args);
  8. }
  9. public static String getStringInput(String prompt) {
  10. Scanner scanner = new Scanner(System.in);
  11. println(prompt);
  12. String userInput = scanner.nextLine();
  13. return userInput;
  14. }
  15. public static Integer getIntegerInput(String prompt) {
  16. Scanner scanner = new Scanner(System.in);
  17. println(prompt);
  18. Integer userInput = scanner.nextInt();
  19. return userInput;
  20. }
  21. public static Double getDoubleInput(String prompt) {
  22. Scanner scanner = new Scanner(System.in);
  23. println(prompt);
  24. double userInput = scanner.nextDouble();
  25. return userInput;
  26. }
  27. }