From 0cac8482b6506975e0b6af3f35726aba400a9814 Mon Sep 17 00:00:00 2001 From: Deathsbreed Date: Thu, 10 Apr 2014 18:06:07 -0500 Subject: [PATCH] Fixed median verbose print. --- src/MMMCalc.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/MMMCalc.java b/src/MMMCalc.java index 3d9f040..f6000e9 100644 --- a/src/MMMCalc.java +++ b/src/MMMCalc.java @@ -144,10 +144,20 @@ public class MMMCalc { if(verbose) { for(int i = 0; i < numArray.length; i++) { - if(i == midVar) { - System.out.print(">" + numArray[i] + "< "); + if(even) { + if(i == midVar - 1) { + System.out.print(">" + numArray[i] + " !" + median + "! "); + } else if(i == midVar) { + System.out.print(numArray[i] + "< "); + } else { + System.out.print(numArray[i] + " "); + } } else { - System.out.print(numArray[i] + " "); + if(i == midVar) { + System.out.print(">" + numArray[i] + "< "); + } else { + System.out.print(numArray[i] + " "); + } } } System.out.print("\n\n");