My goal is to have the user be prompted for multiple separate inputs that would store the data in a manner that I could then manipulate.
For example:
Question:
What is your username?
What is your name?
Input:
Sparkeyy
Nelson
I then want to be able to take these and add them / multiply if they're numbers. This is what I have so far. (Also first question so sorry for poor formatting)
import java.util.*;
public class Program{
public static void main(String args[]){
System.out.println("Enter your username: ");
Scanner scanner = new Scanner(System.in);
String username = scanner.nextLine();
System.out.println("Your username is " + username);
}
public static void (name){
System.out.println("Enter your name: ");
Scanner scanner = new Scanner(System.in);
String name = scanner.nextLine();
System.out.println("Your name is " + name);
}
}