0
public class Wheel{
   public int faceValue;
   public string[ ] fruitNames=new string[5];
   public Wheel(string[ ] fruits){
     for(int i=0; i<fruits.Length; i++){
       fruitNames[i]=fruits[i];
     }
   }

   public void Spin( ) {
     Random rdm=new Random( );
     faceValue=rdm.Next(5);
   }

   public string GetFaceValue( ){
    return fruitNames[faceValue];
   }
 }

How to calculate Cyclomatic complexity for this program? So I need to draw cfg.

halfer
  • 19,824
  • 17
  • 99
  • 186
Ella
  • 1
  • I'm assuming this is Java, so have retagged. Would you explain a bit more what help you are looking for? – halfer Oct 16 '16 at 10:40
  • This is c# code. I would like to know how to draw control flow graph and then how to calculate Cyclomatic Complexity for this Wheel class? – Ella Oct 16 '16 at 11:25
  • I wonder if two things would help here: showing how you are calling this instantiating and calling this class, and showing your attempt at drawing the CFG. Can you explain where you are stuck? – halfer Oct 16 '16 at 11:54

0 Answers0