Java address sticker

By | 11/11/2014

The program asks for information and prints them out in a address sticker -like form.

AddressSticker.java:

import java.util.Scanner;

public class AddressSticker {
 public static void main(String[] args) {
  String name, address, postalCode, city;
		
  Scanner input = new Scanner(System.in);
  System.out.println("Insert the following data:");
			
  System.out.print("Full name: ");
  name=input.nextLine();
			
  System.out.print("Address: ");
  address=input.nextLine();
			
  System.out.print("Postal Code: ");
  postalCode=input.nextLine();
			
  System.out.print("City: ");
  city=input.nextLine();
  input.close();
		
  System.out.println("\n");
  System.out.println(name);
  System.out.println(address);
  System.out.println(postalCode+" "+city);
 }
}

Leave a Reply

Your email address will not be published. Required fields are marked *