Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Ask for user input. Their input must be added to an array named "ints". Only ints are allowed in this one.
- * Then ask for user input again and add their input to an array named "doubles". This array must only be doubles.
- * Then ask for user input again and add their input to a float named "String". Must only be Strings in this array.
- *
- * Repeat this 3 times.
- * if any of the numbers in the int array do NOT evenly divide by 5, print: #here# "Not this one!"
- * Print each array. Only have 1 value of the array per line. For example:
- * String Array:
- * dog
- * cat
- *
- * int Array:
- * 12
- * 13
- *
- * double Array:
- * 12.5
- * 32.61
- *
- * NOTE: Make sure to use as many classes as possible for practice.
- * -------------
- * Once done with this assignment, try to create a calculator and a tic-tac-toe board using arrays.
- */
- package practiceProblem2;
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- userInput();
- }
- public static void userInput() { // need to figure out how to do user input.
- Scanner sc = new Scanner(System.in);
- String stringUI = System.out.println("Please input a String: ");
- String st = sc.nextLine();
- String[] sInputArray;
- for (int x = 1; x <= 3; x++) {
- String[] sInputArray = new String[stringUI];
- System.out.println("String added to sInputArray.");
- sc.close();
- }
- }
- }
Add Comment
Please, Sign In to add comment