...
> It is the test class I am having problems in accepting two command line
> arguments entered as integers the condition are such that the first is the
[quoted text clipped - 4 lines]
> trial)and determine and display the longest run in the trial...How to
> determine the longest run in the trial???.....
...
There seem to be several parts to your question, and I'm not sure what
it is that is giving you trouble.
Have you worked out how to read numeric arguments from the command
line? If not, I suggest doing that in a separate program that just
reports the arguments.
Do you know exactly what you are meant to be doing? If not, I suggest
experimenting with pencil, paper, and a coin, using small numbers of
tosses and trials.
Patricia
First of all, read
http://riters.com/JINX/index.cgi/Suggestions_20for_20Asking_20Questions_20on_20N
ewsgroups#Urgent
> I have created a Trial functional class (a probability problem) for a
> single coin toss of a fair coin that results in heads or tails...over the
[quoted text clipped - 5 lines]
> count of no of tails... Size of array( no of tosses per trial) is
> determined when array is instantiated...
It sounds like you didn't bother to actually type in this post, but just
copy and pasted from the assignment question.
> It is the test class I am having problems in accepting two command line
> arguments entered as integers the condition are such that the first is the
> number of trials must be greater than zero second number of tosses greater
> than zero and less than constant 9999999.
This sentence is difficult to understand. Perhaps some punctuation is
missing?
Anyway, I looked at your code, and you've got this part right.
[most of the code snipped]
> public static void main(String args[])
> {
[quoted text clipped - 4 lines]
>
> if (NumTrials>0 && (NumTosses>0 && NumTosses<9999999))
The actual logic of your program is probably incorrect though. You'll
have to actually reason about what your if statements are checking against,
and what to do in each situation. Try writing your program in pseudocode
first. If you get stuck, post the pseudocode you wrote and we'll help you
from there.
- Oliver