Login to ZARP
Username: Password: Remember me

TOPIC: Need some quick help (Java) Prize

Need some quick help (Java) Prize 7 years 8 months ago #569508

Have some theory questions need to answer

What returns Range (-3,9,-2)



What is printed?

for(int i=1; i<=7; i+=2)
for(int J=0; j<=7; j+=2)
System.out.print(" " + i +j);
System.out.println();


How many times will the value of the variable "i" print

int=0;
while (i < 4)
System.out.println(i);

il give some explosives on ssrp or pointshop points, your choice
  • el une spodermun
  • el une spodermun's Avatar
  • Offline
  • Mythical Boarder
  • ZARP VIP
  • ex retard
  • Posts: 5119
  • Thanks received: 1318
  • Karma: 19
Login or register to post a reply.

Need some quick help (Java) Prize 7 years 8 months ago #569510

wtf is java even used for?
minecraft?
xddd
  • MichaeI
  • MichaeI's Avatar
  • Offline
  • Mythical Boarder
  • ZARP VIP Golden Blue Badge
  • CBR500R
  • Posts: 5164
  • Thanks received: 1060
  • Karma: -7
Login or register to post a reply.

Need some quick help (Java) Prize 7 years 8 months ago #569511

for(int i=1; i<=7; i+=2)

Why I+=2

Shouldn't it be I++? to increase I?
  • AfroHat
  • AfroHat's Avatar
  • Offline
  • Expert Boarder
  • ZARP VIP
  • Anime or Life?..... Anime.
  • Posts: 1562
  • Thanks received: 354
  • Karma: 23
Login or register to post a reply.

Need some quick help (Java) Prize 7 years 8 months ago #569514

is this python lol?
  • Lewis_is_java
  • Lewis_is_java's Avatar
  • Offline
  • Adept Boarder
  • ZARP VIP
  • Λεωνίδᾱς
  • Posts: 7205
  • Thanks received: 4709
  • Karma: -65
Login or register to post a reply.

Need some quick help (Java) Prize 7 years 8 months ago #569515

Okay first of all

for(int i=1; i<=7; i+=2)
for(int J=0; j<=7; j+=2)
System.out.print(" " + i +j);
System.out.println();

This function runs the variables I and J while they are equal or smaller than 7, I starts from 1 and J from 0 each increasment is by 2.
So whats printed is:

" " - a space then I and J while they are lower than 7:

so like this:
1 2
3 4
5 6
7 8

int=0;
while (i < 4)
System.out.println(i);

I wont print cause the function only runs while I is bigger than 1. (for(int i=1; i<=7; i+=2))
  • AfroHat
  • AfroHat's Avatar
  • Offline
  • Expert Boarder
  • ZARP VIP
  • Anime or Life?..... Anime.
  • Posts: 1562
  • Thanks received: 354
  • Karma: 23
Last Edit: 7 years 8 months ago by AfroHat.
Login or register to post a reply.
The following user(s) said Thank You: el une spodermun

Need some quick help (Java) Prize 7 years 8 months ago #569516

Never mind
  • DEADMONSTOR
  • DEADMONSTOR's Avatar
  • Offline
  • Former Owner
  • ZARP VIP
  • Posts: 9277
  • Thanks received: 3799
  • Karma: 80
...
Last Edit: 7 years 8 months ago by DEADMONSTOR.
Login or register to post a reply.

Need some quick help (Java) Prize 7 years 8 months ago #569520

AfroHat wrote:
Okay first of all

for(int i=1; i<=7; i+=2)
for(int J=0; j<=7; j+=2)
System.out.print(" " + i +j);
System.out.println();

This function runs the variables I and J while they are equal or smaller than 7, I starts from 1 and J from 0 each increasment is by 2.
So whats printed is:

" " - a space then I and J while they are lower than 7:

so like this:
1 2
3 4
5 6
7 8

int=0;
while (i < 4)
System.out.println(i);

I wont print cause the function only runs while I is bigger than 1. (for(int i=1; i<=7; i+=2))
Awesome thanks <3

What about
Range (-3,9,-2)
What does it return
  • el une spodermun
  • el une spodermun's Avatar
  • Offline
  • Mythical Boarder
  • ZARP VIP
  • ex retard
  • Posts: 5119
  • Thanks received: 1318
  • Karma: 19
Login or register to post a reply.

Need some quick help (Java) Prize 7 years 8 months ago #569526

el une spodermun wrote:
AfroHat wrote:
Okay first of all

for(int i=1; i<=7; i+=2)
for(int J=0; j<=7; j+=2)
System.out.print(" " + i +j);
System.out.println();

This function runs the variables I and J while they are equal or smaller than 7, I starts from 1 and J from 0 each increasment is by 2.
So whats printed is:

" " - a space then I and J while they are lower than 7:

so like this:
1 2
3 4
5 6
7 8

int=0;
while (i < 4)
System.out.println(i);

I wont print cause the function only runs while I is bigger than 1. (for(int i=1; i<=7; i+=2))
Awesome thanks <3

What about
Range (-3,9,-2)
What does it return

I don't think that would even work.

Isn't it start -3 end 9 and interval at -2 so it wouldn't work?

-3 -5 bleh

Would never get there?
  • DEADMONSTOR
  • DEADMONSTOR's Avatar
  • Offline
  • Former Owner
  • ZARP VIP
  • Posts: 9277
  • Thanks received: 3799
  • Karma: 80
...
Login or register to post a reply.
The following user(s) said Thank You: el une spodermun

Need some quick help (Java) Prize 7 years 8 months ago #569529

DEADMONSTOR wrote:
el une spodermun wrote:
AfroHat wrote:
Okay first of all

for(int i=1; i<=7; i+=2)
for(int J=0; j<=7; j+=2)
System.out.print(" " + i +j);
System.out.println();

This function runs the variables I and J while they are equal or smaller than 7, I starts from 1 and J from 0 each increasment is by 2.
So whats printed is:

" " - a space then I and J while they are lower than 7:

so like this:
1 2
3 4
5 6
7 8

int=0;
while (i < 4)
System.out.println(i);

I wont print cause the function only runs while I is bigger than 1. (for(int i=1; i<=7; i+=2))
Awesome thanks <3

What about
Range (-3,9,-2)
What does it return

I don't think that would even work.

Isn't it start -3 end 9 and interval at -2 so it wouldn't work?

-3 -5 bleh

Would never get there?
It confused me as well, guess the teacher was high or something, but i just found it it was a trick question lmao. Would just have to explain
That Range (Start,Stop,Step) and that it would never get to -9
  • el une spodermun
  • el une spodermun's Avatar
  • Offline
  • Mythical Boarder
  • ZARP VIP
  • ex retard
  • Posts: 5119
  • Thanks received: 1318
  • Karma: 19
Last Edit: 7 years 8 months ago by el une spodermun.
Login or register to post a reply.

Need some quick help (Java) Prize 7 years 8 months ago #569530

lMichaell wrote:
wtf is java even used for?
minecraft?
xddd

this?
honestly curious what all these numbers and print shit is used for, like what the heck do you code with java?
  • MichaeI
  • MichaeI's Avatar
  • Offline
  • Mythical Boarder
  • ZARP VIP Golden Blue Badge
  • CBR500R
  • Posts: 5164
  • Thanks received: 1060
  • Karma: -7
Login or register to post a reply.

Need some quick help (Java) Prize 7 years 8 months ago #569548

lMichaell wrote:
lMichaell wrote:
wtf is java even used for?
minecraft?
xddd

this?
honestly curious what all these numbers and print shit is used for, like what the heck do you code with java?

Java is often used for programming games and mobile applications, but these numbers you saw here are more for a mathematical purpose and to test our logical thinking. But these types of code is for when you want to give something a number value to trigger an action
  • el une spodermun
  • el une spodermun's Avatar
  • Offline
  • Mythical Boarder
  • ZARP VIP
  • ex retard
  • Posts: 5119
  • Thanks received: 1318
  • Karma: 19
Last Edit: 7 years 8 months ago by el une spodermun.
Login or register to post a reply.
Time to create page: 0.124 seconds

206 PLAYERS ONLINE

Connect to server View Gametracker DarkRP 1
11/127
online
Connect to server View Gametracker Deathrun
0/40
online
Connect to server View Gametracker TTT
0/47
online
Connect to server View Gametracker Bhop
0/32
online
Connect to server View Gametracker Surf
4/32
online
Connect to server View Gametracker Prop Hunt
0/42
online
Connect to server View Gametracker Sandbox
0/42
online
Connect to server Discord
191/958
online
Top