Search:

Type: Posts; User: napenthia

Search: Search took 0.10 seconds.

  1. Re: Would You Use Loops and If/Else for This?

    Thanks for posting it, I get how to use now, well sorta. But when doing the average, why is it that you have to put the (double) like that, I saw it in my book but it doesnt explain why.
    On another...
  2. Re: Would You Use Loops and If/Else for This?

    ok i used the while loop with a sentinel value, and put the average at the end like you suggested here is what i got. would you mind posting the way you did it so that i can compare, and so that i...
  3. Re: Would You Use Loops and If/Else for This?

    ok so i change that, but i still need to find a way to calculate the average, would i still need the if statement then?
  4. Re: Would You Use Loops and If/Else for This?

    ok this is what i have so far but i am a little confused as how to incorporate the if statement in here, should i change anything?



    import java.util.Scanner;

    public class Main {

    ...
  5. Re: Would You Use Loops and If/Else for This?

    ok cool, im gonna try it out and ill post what i have for you to check but what kind of loop should i be using? I thought maybe a do while loop but im not sure
  6. Would i use loop or if/else which reads a list of positive integers and calculate their average?

    Design and implement an application that reads a list of positive integers values and calculate their average. List terminates with -1.

    What I would like to know is would I be using the if/else...
Results 1 to 6 of 6