Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class fedEx {
- public static void main(String[] args) {
- // TODO Autogenerated method stub
- String address[] = {"Norre Sogade, 7 1TV", "Gyldenlovesgade, 3 3TV", "Schacksgade, 20 2TV",
- "Vesterbrogade, 10 5TV", "Borgsgade, 6 4TV", "Fredericiagade, 12 3TV", "Rigensgade, 40 1TV",
- "Oster Voldgade, 15 2TV", "Stockholmsgade, 57 3TV", "Adelgade, 35 3TV"};
- int zipCode[] = {1370, 2100, 1951, 1881, 3600, 2001, 1756, 2005, 2006, 1420};
- String temp1;
- int temp2;
- for(int i=0; i<address.length; i++)
- {
- for(int j=1; j<(address.length1); j++)
- {
- if(address[j1].compareTo(address[j])<0)
- {
- temp1 = address[j1];
- address[j1] = address[j];
- address[j] = temp1;
- temp2 = zipCode[j1];
- zipCode[j1] = zipCode[j];
- zipCode[j] = temp2;
- }
- }
- }
- for(int i=0; i<address.length; i++)
- System.out.println("Send this letter/packet to this address: " + address[i] + ", " + zipCode[i]);
- }//class ends
- }//program ends
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement