java hwk help lol

Discussion in 'Programming General' started by khalsa, Feb 23, 2009.

java hwk help lol
  1. Unread #1 - Feb 23, 2009 at 11:57 AM
  2. khalsa
    Joined:
    Feb 15, 2007
    Posts:
    326
    Referrals:
    0
    Sythe Gold:
    0

    khalsa Forum Addict

    java hwk help lol

    yeah need help with this java work,if this not allowed den dlete,erm might be willing to pay rs gp if some1 can do all for me.

    basically i have to do a mandatory java class and i have no clue what to do lol
    ----------------------------------------------------------------------------------

    1)What are all possible results of the expression (n % m), where n and m are integer variables?

    2) int myFirstValue = 3;
    int mySecondValue = 5;

    // print initial values
    System.out.print("myFirstValue - " + myFirstValue);
    System.out.print("mySecondValue - " + mySecondValue);

    // assign values
    mySecondValue = myFirstValue;

    // print modified values
    System.out.print("myFirstValue - " + myFirstValue);
    System.out.print("mySecondValue - " + mySecondValue);


    ^^ what does that code print

    3)Write a for loop which prints the values 5 10 15 20 25 30 35 40. You are advised to use the CodePad to test your code works.

    4)Write a for loop which loops 26 times and thereby prints the characters ABCDEF....Z. You are advised to use the CodePad to test your code works.

    You are reminded that System.out.print((char)65); will print out the single character A (because the character value of an 'A' is 65). The character value of an 'B' is 66, etc

    5)Write a for loop which uses an iteration variable of type double. This should start with a value of 0.5, iterate by steps of 0.3 until the iteration variable exceeds 2. Run the loop, maybe using the CodePad. What is produced? Explain why. Hint: how are floating point ('real') numbers stored?

    6)
    public int refundBalance()
    {
    return balance;
    balance = 0;
    }

    What do you know about return statements that helps to explain why this version does not compile?
     
  3. Unread #2 - Feb 24, 2009 at 3:17 AM
  4. draggin pure
    Joined:
    Apr 7, 2008
    Posts:
    1,429
    Referrals:
    0
    Sythe Gold:
    0

    draggin pure Guru
    Banned

    java hwk help lol

    you explain shit really bad.

    o... this is the actual assignment lul...

    well.. i would show up your teacher by ... doing this..

    really turn what im about to put here lol

    Code:
    
    public class test {
    
    int myFirstValue = 3;
    int mySecondValue = 5;
    
    System.out.print("myFirstValue - " + myFirstValue);
    System.out.print("mySecondValue - " + mySecondValue);
    
    mySecondValue = myFirstValue;
    
    System.out.print("myFirstValue - " + myFirstValue);
    System.out.print("mySecondValue - " + mySecondValue);
    
    public int refundBalance()
    {
    return balance;
    balance = 0;
    }
    
    public int loop(); {
    learn java :)
    
    }
    }

    ok dude now.. you have to learn so you do the rest :D
     
  5. Unread #3 - Feb 27, 2009 at 10:15 PM
  6. SuF
    Joined:
    Jan 21, 2007
    Posts:
    14,212
    Referrals:
    28
    Sythe Gold:
    1,234
    Discord Unique ID:
    203283096668340224
    <3 n4n0 Two Factor Authentication User Community Participant Spam Forum Participant Sythe's 10th Anniversary

    SuF Legend
    Pirate Retired Global Moderator

    java hwk help lol

    PM me your MSN... Or aim... I will help you through this...
     
< Making a runescape Client | Making a shutdown timer. need help with the timer part >

Users viewing this thread
1 guest


 
 
Adblock breaks this site