Advertisement
Promi_38

Main

Dec 7th, 2021
827
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.66 KB | None | 0 0
  1.  
  2. import java.util.HashMap;
  3.  
  4. public class Main {
  5.  
  6.     public static void main(String[] args) {
  7.  
  8.         HashMap<String, Country> countries = new HashMap<>();
  9.         countries = initiateCountries();
  10.  
  11.         HashMap<String, PostOffice> POs = new HashMap<>();
  12.         POs = initiatePostOffices();
  13.  
  14.         Address horiAddress = new Address("Hori Nibash","Green City", "Hawlderpara", "Sylhet", countries.get("Bangladesh"));
  15.         Recipient hori = new Recipient("Horipriya Das Arpita", "01550050058", "hori68@gmail.com", horiAddress);
  16.         Address priyaAddress = new Address("Priyar It er Ghor", "Lake City", "Sillicon Valley", "California", countries.get("USA"));
  17.  
  18.         Recipient priya = new Recipient("Jerin Hasan Priya", "99999999", "priya_dushtu@gmail.com", priyaAddress);
  19.  
  20.         Address promiAddress = new Address("Sanzida Bagh Kella", "Lalbagh",POs.get("Sylhet Head Post Office"),"Dhaka",countries.get("Bangladesh"));
  21.  
  22.         Recipient promi = new Recipient("Sanzida Afrin Promi", "12345678", "sanzida_promi@gmail.com", promiAddress);
  23.         hori.getRecipient();
  24.         priya.getRecipient();
  25.         promi.getRecipient();
  26.     }
  27.  
  28.     private static HashMap<String, Country> initiateCountries() {
  29.  
  30.         HashMap<String, Country> countries = new HashMap<>();
  31.         Country country;
  32.  
  33.         country = new Country("Bangladesh", "+880", "Asia");
  34.         countries.put("Bangladesh", country);
  35.  
  36.         country = new Country("India", "+091", "Asia");
  37.         countries.put("India", country);
  38.  
  39.         country = new Country("Myanmar", "+123", "Asia");
  40.         countries.put("Myanmar", country);
  41.  
  42.         country = new Country("USA", "+001", "North America");
  43.         countries.put("USA", country);
  44.  
  45.         country = new Country("Germany", "+666", "Europe");
  46.         countries.put("Germany", country);
  47.  
  48.         country = new Country("Russia", "+999", "Russia");
  49.         countries.put("Russia", country);
  50.  
  51.         return countries;
  52.     }
  53.  
  54.     private static HashMap<String, PostOffice> initiatePostOffices() {
  55.         HashMap<String, PostOffice> POs = new HashMap<>();
  56.         PostOffice PO;
  57.  
  58.         PO = new PostOffice("Sylhet Head Post Office", "Tamabil", "1111", "01999887338", "Sajon Baha");
  59.         POs.put("Sylhet Head Post Office", PO);
  60.  
  61.         PO = new PostOffice("New Market Post Office", "New Market", "1205");
  62.         POs.put("New Market Post Office", PO);
  63.  
  64.         PO = new PostOffice("Sub-Post office, SUST", "Akhalia", "2222");
  65.         POs.put("Sub-Post office, SUST", PO);
  66.  
  67.         PO = new PostOffice("Putin bhai er post office", "Moscow", "9999");
  68.         POs.put("Sub-Post office, SUST", PO);
  69.  
  70.         return POs;
  71.     }
  72.  
  73. }
  74.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement