Untitled
unknown
plain_text
3 years ago
1.5 kB
11
Indexable
package COM.Sample;
import java.util.Scanner;
public class Personalinformation {
//• Your name • Your address, with city, state, and ZIP • Your telephone number • Your
//college major Although these items should be displayed on separate output lines, use only a single println statement in your program.
public static void main(String[] args) {
Scanner Keyboard = new Scanner(System.in);
System.out.println("Enter your name");
String name = Keyboard.nextLine();
Scanner type_address = new Scanner(System.in);
System.out.println("Enter your address");
String address = type_address.nextLine();
Scanner type_city = new Scanner(System.in);
System.out.println("Enter your city");
String city = type_city.nextLine();
Scanner type_state = new Scanner(System.in);
System.out.println("Enter your state");
String state = type_state.nextLine();
Scanner type_PostleCode = new Scanner(System.in);
System.out.println("Enter your PostleCode");
String PostleCode = type_PostleCode.nextLine();
Scanner type_salary = new Scanner(System.in);
System.out.println("Enter your salary");
Float salary = type_salary.nextFloat();
Scanner type_collegemajor = new Scanner(System.in);
System.out.println("Enter your collegemajor");
String collegemajor = type_collegemajor.nextLine();
System.out.println("My name is "+name+"\n"+address+"\n"+city+"\n"+state+"\n"+PostleCode+"\n"+salary+"\n"+collegemajor);
}
}Editor is loading...