Menu

#843 week 1 exercise 23

Content error
closed
nobody
None
2016-03-17
2016-03-06
No

can anyone help me out?

while(true)
{
System.out.println("Enter number of input values");
int number=Integer.parseInt(reader.nextLine());
System.out.println("Start inputting the values");
double value=Double.parseDouble(reader.nextLine());
if(value>=-30&&value<=40)
{

        for(int i=0;i<=number;i++){


        Graph.addNumber(value);

        }
        break;}
    }

    where's the mistake?

Discussion

  • Jarmo

    Jarmo - 2016-03-07

    What's up with the for loop?

    I'm pretty sure it shouldn't be there. Just add the number user typed in if it passes the criteria (the checks in the if statements.

     
  • ljleppan

    ljleppan - 2016-03-17
    • status: open --> closed