:sad: Hi all, been trying to code the following program for ages, if anyone can help please do so.

Code a java program that will determine the cyclomatic complexity(CC) of any given java source code module held in a text file. The program is to display the CC. Note- CC=Number of simple conditional statements (ifs, whiles, repeats, etc) + 1.

Please choose a different name for your thread titles in the future. "Help Needed Urgently With Coding" tells us nothing specific about what you need ( I mean, you've posted in a Coding forum, obviously you need coding help).

Additionally, stating you need help "Urgently" is rude. It is rude to the other members who have posted here before you. Urgent to you or not, wait your turn.

>if anyone can help please do so.
I don't see a problem. Open the Java source file, read it line by line, and do a string search for the appropriate keywords. The result is a good start for your solution; you can refine the search from there on the off chance that one of the keywords is a part of a larger identifier.

Please choose a different name for your thread titles in the future. "Help Needed Urgently With Coding" tells us nothing specific about what you need ( I mean, you've posted in a Coding forum, obviously you need coding help).

Additionally, stating you need help "Urgently" is rude. It is rude to the other members who have posted here before you. Urgent to you or not, wait your turn.

Sorry for being so rude, first time on the site. In future I will name my thread correctly. Thank you for your advice. If possible you could please help me.

Post some code so that we can see that you've made an attempt at solving the problem. A naive solution is immediately obvious and easily written. If you've put some effort into this problem then you'll have a workable solution and thus, a specific question as to how it can be improved.

This article has been dead for over six months. Start a new discussion instead.