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?
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?











