From a psychological view, complexity varies in terms of nodes, as different analyst interprets nodes differently (some consider two sequences as one node while other treat them separately) but the underlying principle remains the same.
Using the P+1 formulae will tell you whether you're right or wrong if you're calculating from a given piece of code. P = Predicate. A predicate is where you have branches in your code. Eg.
From your code, I can see three predicates; Therefore 3P + 1 = 4 Regions and your answer shows only three regions.
You might want to look at it again.
Life is not perfect, but the way you live it can make it perfectly wonderful
I'm still in control here. LOOK at this tiny ad!
create, convert, edit or print DOC and DOCX in Java