• Post Reply Bookmark Topic Watch Topic
  • New Topic

Need help  RSS feed

 
Adriana Casey
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

can someone help my with this tasks?

Create an executive class which accepts one argument through a command line.
Make a doubple.parseDouble() conversion on the input argument, print a division table from 31 to 150 with the argument.
Note the "division by zero" case either by the apropriate exception or a using a condition.

This is all I have, any advice would be helpful. Thank you.

 
Stuart A. Burkett
Ranch Hand
Posts: 679
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Foxy Fox wrote:Create an executive class which accepts one argument through a command line.

I would interpret this line to mean the value is passed as a parameter to the program (and hence will appear in the args array) rather than being prompted for by the program.

Foxy Fox wrote:print a division table from 31 to 150 with the argument.

Do you know what a division table is ? I'm not familiar with the term, so you might need to explain it to get some help. Forget about code for the moment and just try describing the process for creating the table in English (or your own language). If you make the description detailed enough, it should become clearer how to write the code.
 
Adriana Casey
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That part is unclear to me too, but that's the text of the problem i received from my professor no more no less.
This is how I understood it, the division table has rows ranging from 31 till 150 and columns are derived from the user input.
I'm guessing the print should look like this (the "2" column is the user input argument column and should show the results of the row number(31-150) divided by the user input argument):

2
31 15,5
32 16
33 16,5
34 17
 
Stuart A. Burkett
Ranch Hand
Posts: 679
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That sounds reasonable.
So if someone asked you to write that table on a piece of paper, how would you go about it ?
Once you've worked that out, it should be straightforward to write the code. Have a go and then show us what you've got if you get stuck.
 
Adriana Casey
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your help, I kinda figured it all out.
 
Mansukhdeep Thind
Ranch Hand
Posts: 1163
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the ranch Foxy Fox .
 
Adriana Casey
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!