Forums Register Login

Need help

+Pie Number of slices to send: Send
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.

+Pie Number of slices to send: Send
 

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.
+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
Thank you for your help, I kinda figured it all out.
+Pie Number of slices to send: Send
Welcome to the ranch Foxy Fox .
+Pie Number of slices to send: Send
Thank you!
Remember to always leap before you look. But always take the time to smell the tiny ads:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 909 times.
Similar Threads
Too much execution time
Again and again and... [infinite recursion]
read data from keyboard
input from console
Arrays
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 18:30:33.