Advertisement
OlegB

sdfsdf

Mar 29th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.22 KB | None | 0 0
  1. package model;
  2.  
  3. import java.util.Comparator;
  4.  
  5. /**
  6.  * Created by Oleg on 23.03.2017.
  7.  */
  8. public class Task {
  9.     public static void main(String[] args) {
  10. //        Exchange[] exchanges = new exchange[4];
  11. //        Exchange[0] = new Bank (27.3);
  12. //        Exchange[1] = new Obmenka(27.5);
  13.         Bank pumb = new Bank("Pumb", "Sumsskaya,13", 1985, 27.5);
  14.         Obmenka rosa = new Obmenka("Rosa", "Rozi_L.5", 27.25);
  15.         Creditcafe cafecredit = new Creditcafe("Cafecredit", "Culture,5", 4_000, 200);
  16.         Credit_Union soyuz = new Credit_Union("Soyuz", "Ploshana, 24", 100_000, 20);
  17.         PIF pif = new PIF("Pif", "Klochkovskaya.32", 12);
  18.         Post pochta = new Post("Pochta", "Privokzalnaya,44", 2);
  19.  
  20.         Bank bestExchange = null;
  21.         double maxUsd = 0;
  22.  
  23.         for (Bank company : double convert) {
  24.  
  25.             if (Bank instanceof Exchange) {
  26.                 double currentUsd = ((Exchange) exchange).convertUahToUsd(20_000);
  27.  
  28.                 if (maxUsd < currentUsd) {
  29.                     bestExchange = exchange;
  30.                     maxUsd = currentUsd;
  31.                 }
  32.             }
  33.         }
  34.         System.out.println("The best course of usd is in: " + bestExchange.getInfo());
  35.  
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement