Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Mandelbrot

 
Mike Shn
Ranch Hand
Posts: 149
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello
Does someone know a smart solution for that problem?
Write a program that reads c and the number of generations from the command line, and prints that many iterations of the Mandelbrot equation. Also print (at the beginning of the output) the value used for c.
Be sure to handle all users errors (e.g. not providing two values on the command line) to the extent possible. Check the ranges of the data the user enters (e.g. don�t let the number of generations be less than 0). Print an error message and exit if a value outside the allowed range is entered. Provide a default value if none is given.
Detect if divergence has occurred (absolute value greater than 2) and stop output if so.
Thanks
 
Marilyn de Queiroz
Sheriff
Posts: 9063
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like an assignment. What is your specific question. I hope you are not expecting someone to write the assignment for you...
 
Roseanne Zhang
Ranch Hand
Posts: 1953
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sheriff
You need stop this kind of practice. The same question post 3 or more forums. Throw teacher's assignment here, even without a little bit his/her own thinking.
This is not what JavaRanch for...
I've seen several already. This one is one of the worst.

Thanks!
Roseanne
Join our SCJD Study Group when certified

 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Mike Shn:
Also print (at the beginning of the output) the value used for c.
Be sure to handle all users errors
Check the ranges of the data the user enters (e.g. don�t let the number of generations be less than 0).
Print an error message and exit if a value outside the allowed range is entered.
Provide a default value if none is given.
Detect if divergence has occurred (absolute value greater than 2) and stop output if so.


Any more orders?
 
William Barnes
Ranch Hand
Posts: 986
Eclipse IDE Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Fries and a shake.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic