This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Question About Nested Loops Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Question About Nested Loops" Watch "Question About Nested Loops" New topic

Question About Nested Loops

Philip Jenson

Joined: Jan 24, 2007
Posts: 21
I was told to write a small program that finds the floor of logb(X). I took the main functionality of the program to create what I pasted below. In the program I have below, the base and x-value are already there - it's just for the concept.

I was told to use nested loops. However, I feel that the way I did it is fine. Would it be better if I used a nested loop? I'm not sure I would know exactly how to go about doing it, thought I'm sure there are a lot of ways to do it.


Joanne Neal

Joined: Aug 05, 2005
Posts: 3432
If your assignment was to write a program that finds the floor of logb(X), then the method you use is up to you.
If your assignment was to write a program that uses nested loops, then you need to use nested loops.
You need to ask whoever gave you the assignment whether what you have done is okay.

With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Question About Nested Loops
Similar Threads
Using Nested For Loops To Make Triangle
indexed and non-indexed input
Preincrement used in an expression
private method
I need some elaborations on this code