My two tasks are not getting validated and I am unable to find the cause of failure. Could anyone please help? I am displaying a number on screen and my program displays the maximum of all.
package com.codegym.task.task05.task0532;
import java.io.*;
/*
Task about algorithms
*/
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
double maximum = 0;
//write your code here
while (true)
{
String s = reader.readLine();
if (s.equals("exit"))
break;
double max = Double.parseDouble(s);
if (max > maximum)
maximum = max;
else
continue;
}
System.out.println("Maximum = " + maximum );
}
}