That is because this code does not read each n from the file, it just reads once from the file and sets it to maxDen thats it. You would require to read n and set it to maxDen every time so that it would require another for / while / do-while loop. Thats what the assignment statement reads

[I]Requires nested loop with the inner loop summing up series and outer loop allow inner code to repeat once for each n read in from file[/I]

What is the output you are getting ? Tell us where exactly are you facing problem.

Ahhh.... You write a post about something that seems to you as though it would be helpful, but then someone down votes you. So much for the trouble. :)

java.. commented: ridicule someone's reply... +0

[QUOTE]in DogTestDrive class check whether you import Dog class or not ..[/QUOTE]
Not at all necessary. If both the classes Dog and DogTestDrive are in the same directory then it isn't required that the referring class requires to add an import statement. This is true even if the Dog class is not mentioned as public. If you do not mention a class as public it's access specifier falls to 'default' i.e package access but since none of the classes are within a package and rest within the same directory the access is permitted. Both OP and you can try it for your self.

Now if your class Dog is in a package let's say "foo.bar" and your DogTestDrive class too is declared within the same package then the case goes back to the first one as explained above. Then effectively both these classes are in the same directory and nothing needs to imported and in fact, as mentioned above the Dog class doesn't even need to public in that case. But if your DogTestDrive is in a different package or more specifically not in the same package as that of Dog (since it can be in no package at all) then there are 2 things required for the DogTestDrive class to compile successfully. Firstly it needs the Dog class to be public, because if it isn't then it simply isn't accessible to outside packages so the import statement even if it exists isn't gonna do you any good. Secondly, if ...

Why is everybody handing out code snippets to the OP here ? Since when did it became the most easiest way of giving solns ? Not to mention some of you have got the assignment wrong completely.

If you could see two of the more senior posters here have both given the solution without providing the code for it. Thats the way it should be done, you make him understand the solution by outlining steps using pseudocode, Simple English etc but I guess not many people here know that way.

Why is everybody handing out code snippets to the OP here ? Not to mention some of you have got the assignment wrong completely.

If you could see two of the more senior pros here have both given the solution without providing the code for it. Thats the way it should be done, you make him understand the solution by outlining steps using pseudocode, Simple English etc but I guess not many people here know that way.

PS: I don't know how and edit caused it to be posted twice, just ignore the next post of mine.

Being in an IT solutions firm, I have seen a lot of so called computer engineers with near to no understanding of programming and what it is all about, whatsoever. I always used to get so amazed knowing this, thinking how somebody who has been trained in that particular subject for 4 years be like this. I owe a big thanks to you for clearing my amazement.

I hope you get it.

Again not a yes/no question. Guys where are you going you are forgetting the rules of the game.

None, I like more of pop music.

Do you like workouts ?

WaltP commented: It was a perfectly good yes/no question -- quite griping -3

What you could do is :

  1. Ask the string to be entered.
  2. Trim it so that any leading/trailing spaces are removed.
  3. Split it on the basis of (internal) spaces so that you can get the individual words in it.
  4. Count the number of words.
  5. Count the length of each word.
  6. Sum it up to get the total letters in the string (assuming you do not want to consider the internal space characters)

Why don't you look it up on the internet. Try finding answers to such questions by searching them on the internet, instead of asking forum members. This will save you time too as also you would have the oppurtunity to learn something else with that.

froppy commented: Unhelpful. Always answer instead of referring elsewhere for the people who get to this page by searching. +0

As stultuske appropriately mentioned it, since it is 50% of the score it certainly must have been given sufficient time to be completed. Yet you did not do it and now you are asking others to do what you did not, maybe just because you were acting plain lazy. In my opinion too I think you deserve to fail, which seen from a different perspective would be better for you too, which I guess you would find out when you do the project on your own and learn a couple of things out of it which o/w you would have not.

peter_budo commented: This wound did not need it more salt. -3

And I'm not going to post any more on this because of some other things that I believe.
No matter you win or lose a rat race you 'd still be a rat.
You can continue as long as you want, I'm here to do other more meaningful things.

[QUOTE=stultuske;752740]
no, I didn't, but you just answered it yourself:
[/QUOTE]

I'had thought you'd give some intelligent answer just as I gave to yours, but instead you are just copy-pasting my answers after I have put them in your face. You know it's so easy to appear intelligent when parroting intelligent people. ;)

Ezzaral commented: This is not constructive here. -3

[QUOTE=stultuske;752603][Code=Java]
if(num=='8')
pluralName="Eighty";
if(num=='9')
pluralName="Ninety";
else
pluralName="Error /w Plural Method";
[/Code]
this will always return "Error /w Plural Method", unless the value for num == '9'
what you want to do (and not only for the '8' check) is using nested if's

[Code=Java]
if(num=='8'){
pluralName="Eighty";
}
else{
if(num=='9'){
pluralName="Ninety";
}
else{
pluralName="Error /w Plural Method";
}
}
[/Code][/QUOTE]

This is a weak example of actually implementing it the right way, it should have been done using switch-case statement and using break as correctly pointed out by the above post. Also this method is far unoptimized since it would check for every 'if' till the num=='8' even if the very first 'if' statement is true. I don't think you want your program to check every condition on every occassion even if the very first condition is true in many of those occassions. ;)