Results 1 to 2 of 2
Like Tree1Likes
  • 1 Post By skynet357

Thread: min, max, total using arrays

  1. #1
    Andie is offline Member
    Join Date
    Mar 2012
    Posts
    8
    Rep Power
    0

    Default min, max, total using arrays

    I'm working on a source code using arrays to where I would have to ask the user of how many numbers, along with inputing them through the keyboard. (This is the part I was able to do). The second part of it, I will be needing to display the list of numbers that the user entered, along with the max, min and total numbers that were entered. This is one part where I am having trouble a bit.

    import java.util.*;

    public class MinMaxTotalProgram {
    public static void main(String args []) {
    Scanner sc = new Scanner(System.in);

    int nums[] = new int[20];

    int min, max, total;


    System.out.print("How many numbers? ");
    int choose = sc.nextInt(); // choose stands for the number the user chooses


    for(int i=0; i < 4; i++) {
    System.out.print("Enter Value: ");
    int value = sc.nextInt(); //value stands for the number that the user enters

    }



    }
    }


    Any suggestions on what I need to do to fix this? Thanks

  2. #2
    skynet357 is offline Member
    Join Date
    Mar 2012
    Location
    Hyderabad, India
    Posts
    8
    Rep Power
    0

    Default Re: min, max, total using arrays

    But you haven't written the section which will search for min ,max and total number..

    Try something first. If it fails then will guide you in right direction. Fair enough isn't it??
    baf06 likes this.

Similar Threads

  1. Running total little help
    By silverspoon34 in forum Forum Lobby
    Replies: 9
    Last Post: 02-27-2011, 10:19 PM
  2. Calculating Total?
    By ethemartian in forum New To Java
    Replies: 6
    Last Post: 02-21-2011, 05:09 AM
  3. Total noob
    By J_Walker in forum New To Java
    Replies: 9
    Last Post: 04-24-2009, 04:10 AM
  4. total beginner needs little help
    By asambasamba in forum New To Java
    Replies: 1
    Last Post: 06-18-2008, 06:33 PM
  5. Printing total out
    By denisdoherty in forum New To Java
    Replies: 1
    Last Post: 04-25-2008, 07:40 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •