There are three kinds of actuaries: those who can count, and those who can't.
Dr. Noorul Hameed, B.Sc., M.C.A, PhD (USM)
Senior IT Engineer
ok so if i get all that going it works but if i enter 5 scores i have to click 5 times and i see my letter grades appear 1 by 1 and the sum and average also go up 1 at a time.
my loop is not looping back before displaying the final joptionpane.
i'm not sure if i need to change the for loop or if i need a return statement. i tried using a return statement a couple different ways and either got an error or the program just doesn't run (visually) and says build complete.
SCJP 5, OCPJP 7, 8, SCJD 5, SCWCD 4, SCBCD 5, SCJWS 4, IBM OOAD 833 & 834, MongoDB Developer
Dr. Noorul Hameed, B.Sc., M.C.A, PhD (USM)
Senior IT Engineer
Noorul Hameed wrote:Hi, The problem is to close the for loop befor last statement, JOptionPane...It can not be inside the loop. It is after for loop completed.
Thanks
Regards
Dr.Noor
SCJP 5, OCPJP 7, 8, SCJD 5, SCWCD 4, SCBCD 5, SCJWS 4, IBM OOAD 833 & 834, MongoDB Developer
Anther thing about else‑if. If your boundary value is included in the upper category, start small. The boundary value for a C is 70, and 70 is included in the C grade, not the D grade. If you start small, you don't need >=, but <. The >= and <= operators aren't actually bad, but < and > are easier to understand.When you write that sort of thing always keep the terms in order, ascending or descending. You might so well to precede that if with something likeRemember it is usually not a good idea to write lots of number literals like that, but that is a different problem.Carey Brown wrote:Not that by using "else if" you no longer need the "&&" component because that is taken care of by the order that these comparisons are made.
Campbell Ritchie wrote:
Carey Brown wrote:
Hi Mr. Rob
This task has already been explored by Mr Cambell Richie. Please have a look at quote here.
something likeRemember it is usually not a good idea to write lots of number literals like that, but that is a different problem.
Thanks.
Dr. Noorul Hameed, B.Sc., M.C.A, PhD (USM)
Senior IT Engineer
Rob Frank wrote:I'm trying to do this
it obviously doesn't work.
SCJP 5, OCPJP 7, 8, SCJD 5, SCWCD 4, SCBCD 5, SCJWS 4, IBM OOAD 833 & 834, MongoDB Developer
All things are lawful, but not all things are profitable.
Of course they can. But I can see problems lining up the grades and the numbers in the array.Rob Frank wrote:i'm also wondering if count A , B, C, D and F can be made into an array. . . .
There are three kinds of actuaries: those who can count, and those who can't.
Rob Frank wrote:(...) i can see how only knowing how to do a few things with java can really complicate the code. not sure learning how to complicate the code should be in a beginning java class. anyways
There are three kinds of actuaries: those who can count, and those who can't.
All things are lawful, but not all things are profitable.
All things are lawful, but not all things are profitable.
There are three kinds of actuaries: those who can count, and those who can't.
Skool. Stay in. Smartness. Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|