Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: isDecreasing assignment help. URGENT

  1. #1
    Junior Member
    Join Date
    May 2019
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation isDecreasing assignment help. URGENT

    Im really new to coding and was wondering if someone could help me complete this.


    We are going to write two methods. Both called isDecreasing. isDecreasing should return true if every next value is smaller than the previous value.

    method header

    public static boolean isDecreasing(int[] a)


    Here are some arrays and the boolean value your method should return.

    1, 2, 3, 4, 5, 6, 7, 8, 9, 10 false
    1, 2, 3, 3, 4, 5, 6, 7, 8, 10 false
    1, 2, 1, 2, 4, 5, 6, 7, 8, 9 false
    10, 9, 8, 7, 6, 5, 4, 3, 2, 1 true
    1, 10, 100, 1000, 1001, 1002, 10000 false

  2. #2
    Member John Joe's Avatar
    Join Date
    Jun 2017
    Posts
    277
    My Mood
    Amused
    Thanks
    8
    Thanked 19 Times in 19 Posts

    Default Re: isDecreasing assignment help. URGENT

    Hi Fanzy,
    We are happy to help , but have you tried anything yet?
    Like create a main method? Done declared int array and so on ?

    From your question:
    We are going to write two methods. Both called isDecreasing. isDecreasing should return true if every next value is smaller than the previous value.
    Why you need two isDecreasing methods instead of one? Are they both function differently?
    Last edited by John Joe; May 10th, 2019 at 12:50 PM.
    Whatever you are, be a good one

  3. #3
    Junior Member
    Join Date
    Apr 2019
    Posts
    25
    Thanks
    0
    Thanked 4 Times in 4 Posts

    Default Re: isDecreasing assignment help. URGENT

    public static boolean isDecreasing(int[] arrays){
            for (int i = 0; i < arrays.length - 1; i++) {
                for (int j = 0; j < arrays.length - 1; j++) {
                    if (arrays[j] < arrays[j + 1]) {
                        return false;
                    }
                }
            }
     
            return true;
        }

    en.verejava.com/?id=20057715770051

  4. #4
    Member
    Join Date
    Sep 2018
    Location
    Virginia
    Posts
    284
    My Mood
    Cool
    Thanks
    0
    Thanked 38 Times in 36 Posts

    Default Re: isDecreasing assignment help. URGENT

    Veretimothy,

    Please read this: The Problem With Spoonfeeding"

    Regards,
    Jim

Similar Threads

  1. Urgent Polynomial Assignment !!!!!!!!!
    By thesoulpatchofBruce in forum What's Wrong With My Code?
    Replies: 3
    Last Post: October 9th, 2012, 01:38 PM
  2. Need Urgent Help for Java assignment..
    By SamanthaBenny93 in forum What's Wrong With My Code?
    Replies: 11
    Last Post: May 22nd, 2012, 08:25 AM
  3. help with array assignment ! urgent please :(
    By dre2327 in forum Collections and Generics
    Replies: 5
    Last Post: October 6th, 2011, 01:30 PM
  4. Need urgent help in assignment of JAVA, any idea suggestion plz
    By aesthete in forum Java Theory & Questions
    Replies: 2
    Last Post: January 6th, 2011, 05:58 AM
  5. nid help for my assignment~urgent
    By x3ahbi in forum What's Wrong With My Code?
    Replies: 2
    Last Post: July 5th, 2010, 02:55 AM

Tags for this Thread