Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package model;
- import java.util.Comparator;
- /**
- * Created by Oleg on 23.03.2017.
- */
- public class Task {
- public static void main(String[] args) {
- // Exchange[] exchanges = new exchange[4];
- // Exchange[0] = new Bank (27.3);
- // Exchange[1] = new Obmenka(27.5);
- Bank pumb = new Bank("Pumb", "Sumsskaya,13", 1985, 27.5);
- Obmenka rosa = new Obmenka("Rosa", "Rozi_L.5", 27.25);
- Creditcafe cafecredit = new Creditcafe("Cafecredit", "Culture,5", 4_000, 200);
- Credit_Union soyuz = new Credit_Union("Soyuz", "Ploshana, 24", 100_000, 20);
- PIF pif = new PIF("Pif", "Klochkovskaya.32", 12);
- Post pochta = new Post("Pochta", "Privokzalnaya,44", 2);
- Bank bestExchange = null;
- double maxUsd = 0;
- for (Bank company : double convert) {
- if (Bank instanceof Exchange) {
- double currentUsd = ((Exchange) exchange).convertUahToUsd(20_000);
- if (maxUsd < currentUsd) {
- bestExchange = exchange;
- maxUsd = currentUsd;
- }
- }
- }
- System.out.println("The best course of usd is in: " + bestExchange.getInfo());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement