DebateFort - Where Warriors Come To Debate
RAGECRY - Funny, Amusing, Interesting, Trending & Viral Videos and Images
GameOrc - Free Flash Games Online

Thread: hw help!

Results 1 to 3 of 3
  1. #1
    TIME TO DIE
    Donator
    sekisho's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Posts
    83
    Reputation
    68
    Thanks
    3
    My Mood
    Yeehaw

    Lightbulb hw help!

    Well let's say I've been missing a couple classes and I need help understanding some of this stuff. Anyone can help me get started and such, itll be great.

    Create a class called Character. The class should have the following public member functions:

    A function called compare, that accepts as parameters two arrays (of type char), and one size variable (of type int) that indicates the size of both arrays. The function should determine if the contents of the two arrays are the same, then return a value (of type bool) depending on whether the contents are the same (true) or not (false).

  2. #2
    Some l33t h4x0r.
    Donator
    Global Moderator
    master131's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    Melbourne, Australia
    Posts
    7,665
    Reputation
    1200
    Thanks
    23,988
    My Mood
    Breezy
    You didn't specify a language...


    Any donations are welcome.
    In the past, I was unable to receive donations despite people wanting to donate for my hard work.
    Thanks in advance! (PS - 1 AUD ≈ 1 USD)


    Handy Tools/Hacks:
    Extreme Injector v2.1
    A powerful and advanced injector in a simple GUI.
    Can scramble DLLs on injection making them harder to detect and even make detected hacks work again!

    Minion Since: 13th January 2011
    Moderator Since: 6th May 2011
    Global Moderator Since: 29th April 2012

    --My Art--
    [Roxas - Pixel Art, WIP]
    [Natsu - Drawn]
    [Natsu - Coloured]


    All drawings are coloured using Photoshop.

    --Gifts--
    [Kyle]

  3. #3
    Novice
    MPGH Member
    dkofek's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Location
    The toilet in the club next to your house
    Posts
    56
    Reputation
    13
    Thanks
    104
    My Mood
    Aggressive
    if you want it in java.. I'll type it here (sorry, I don't have an eclipse on my PC so I can't copy-paste it from there)
    Code:
    public class Character
    {
    //if you need it to be an object - this is the building function
    public Character ()
    {
    
    }
    //if you don't need to create an object, you may want to type in a 'static' like this
    //public static boolean compare(char[] a,char[] b,int slots), slots stands for a.length (or b.length, they're the same)
    public boolean compare(char[] a,char[] b,int slots)
    {
    if(slots==0)
    {
    return true;
    }
    else if(a[slots-1]==b[slots-1])
             return true&&compare(a,b,slots -1);
    return false;
    }
    }
    that's just a recursive way I found which is not too hard to write and understand
    hope it'll help you (:
    Last edited by dkofek; 11-12-2011 at 12:35 PM.

Similar Threads

  1. [Help Request] Combat arms Vid help
    By djw111 in forum Combat Arms Help
    Replies: 4
    Last Post: 12-24-2011, 05:06 PM
  2. [Help Request] AFK Bot [help]
    By fet in forum Combat Arms Help
    Replies: 7
    Last Post: 04-28-2011, 03:17 AM
  3. [Help Request] Injector Admin help
    By asdfgas in forum Combat Arms Help
    Replies: 4
    Last Post: 04-27-2011, 06:12 PM
  4. [Help Request] Ajuda / Help
    By - Battery' in forum Combat Arms BR Coding Help
    Replies: 3
    Last Post: 04-22-2011, 07:15 PM
  5. [Help Request] Help my!
    By Windowns7 in forum Combat Arms BR Coding Help
    Replies: 2
    Last Post: 04-18-2011, 01:41 PM

Tags for this Thread