|
I need to write a method that accepts two ints as arguments, a
min and a max. On the first line i need to print all numbers in that
range (inclusive). On the next line I start with min+1, print all
numbers up to max, and then go back to the front of the range and print
min. Next line I start with min+2, and so on until I have repeated this
starting with each number in the range.Very hard to explain, here's two
examples: Say I pass 1 and 5 as the min and max arguments. I want the
method to print this:
Or if 3 and 9 were passed, I would expect this:
I've tried all kinds of things, I'm sure there is an easy way to do
this that I am not realizing. I'm supposed to do this without arrays or
arrayLists. I think I have a good base to work with, but I just can't
figure out where to go from here. My base code prints this:
And this:
I'm stumped. Here's my code:
|
Follow me
Rabu, 27 November 2013
Contoh Program Penasaran
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar