www.vustudents.ning.com

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.

# CS608 Assignment No 01 Fall 2020 Solution & Discussion Due Date: 28-11-2020

Question No. 1.                                                                                                          (Marks 12)

Draw the Control Flow Graph for the following piece of code.

namespace AssigmntONE

{

public class MyAverage

{

public double ReturnAverage(int[] value, int MIN, int MAX)

{

1. int i, tv, sum;
2. double av;
3. i = 0; tv = 0; sum = 0;
4. while (i < MAX)

{

1. if (value[i] >= MIN && value[i] <= MAX)

{

1. tv++;
2. sum = sum + value[i];

}

1. i++;

}

1. if (tv > 0)
2. av = (double)sum / tv;
3. else
4. av = (double)-999;
5. return (av);

}

}

}

Question No. 2.                                                                                                          (Marks 8)

Find all the independent paths for the graph developed in question 1.

Note:

• You should use Microsoft Visio or some other drawing tool to develop the required Graph for question#1.
• The diagram should be pasted in the MS Word file as an image, and the MS Word (.docx) file should be uploaded on VULMS.

v

Views: 696

Attachments:

### Replies to This Discussion

Our main purpose here discussion not just Solution

Students having same subject can start discussion here to solve assignment, GDB & Quiz and can clear their concepts until solution is provided.

P.S:    Please always try to add the discussion in proper format title like “CS101 Assignment / GDB No 01 Solution & Discussion Due Date: ___________”

Then copy Questions from assignment file and paste in Discussion.

http://bit.ly/vucodes (For Assignments, GDBs & Online Quizzes Solution)

http://bit.ly/papersvu (For Past Papers, Solved MCQs, Short Notes & More)

ksi n bnai h yr assignment?

Kindly Koi solution post kr dy

CS608 Solution Assignment#01 Fall 2020

CS608_Assignment_No_01_Solution_Fall_2020

CS608 Complete Solution Assignment#01 Fall 2020

CS608_Complete_Solution-Assignment#01_Fall_2020

CS608 Solution Assignment#01 Fall 2020

CS608_Assignment_No_01_Solution_Fall_2020

cs608 assignment no 1 solution

CS608 Assignment 1 solution 2020

Question No. 1. (Marks 12)
Draw the Control Flow Graph for the following piece of code.

namespace AssigmntONE
{
public class MyAverage
{
public double ReturnAverage(int[] value, int MIN, int MAX)
{
1. int i, tv, sum;
2. double av;
3. i = 0; tv = 0; sum = 0;
4. while (i < MAX)
{

5. if (value[i] >= MIN && value[i] <= MAX)
{
6. tv++;
7. sum = sum + value[i];
}
8. i++;
}
9. if (tv > 0)
10. av = (double)sum / tv;
11. else
12. av = (double)-999;
13. return (av);
}

}
}

Solution:

Question No. 2. (Marks 8)
Find all the independent paths for the graph developed in question 1.
Independent paths = 13-12+2
Independent paths = 3

CS608 Complete Solution Assignment#01 Fall 2020

CS608_Complete_Solution-Assignment#01_Fall_2020

1

2

3

4

5

## Latest Activity

AbdulRabecca and Wasim joined + M.Tariq Malik's group

### PAD603 Governance, Democracy and Society

51 seconds ago
Raja Ashyan joined + M.Tariq Malik's group

### CS314 Introduction to Cellular Networks

1 minute ago
AbdulRabecca liked Hira's profile
6 minutes ago
AbdulRabecca, Sana Shah, Salar khan and 30 more joined Virtual University of Pakistan
6 minutes ago
sweet angel joined + M.Tariq Malik's group

### ENG522 Applied Linguistics

24 minutes ago
41 minutes ago
Sana Shah joined + M.Tariq Malik's group

### CS401 Computer Architecture and Assembly Language Programming

44 minutes ago
Awab Abu Bakar posted a discussion

48 minutes ago