Question

In: Computer Science

Program Slicing Assignment 1- Choose a program you’d like to analyze. Explain what the program’s purpose...

Program Slicing Assignment

1- Choose a program you’d like to analyze. Explain what the program’s purpose is and how many lines of code it has.

2- Browse the tools necessary for slicing and install if you haven’t already done so.

If there is a problem with the tool, and you would not like to use it, explain:

What the tool is used for, and why wouldn’t use it.

3- demonstrate static, dynamic, forward, and backward slicing using a slicing criterion.

In a documentation, submit examples and descriptions of each static and dynamic slicing. Submit descriptions and examples of forward and backward slicing.

3- demonstrate static, dynamic, forward, and backward slicing using a slicing criterion.

Solutions

Expert Solution

As it is not mentioned which question needs to be done, I am doing the first two questions of this assignment

(A) I would like to analyze a program which helps to find the factorial of a number

Purpose -: The purpose of this program is to find the factorial of the user inputted number using recursive function.

Number of lines in the code is as follows -:

14 physical lines of code excluding whitespace, including logical lines of codes

PROGRAM -:

class Test {

static int factorial(int n)

{

if(n == 0)

return 1;

return(n* factorial(n-1))

}

public static void main(String[] args)

{

Scanner sc = new Scanner(System.in);

int num = sc.nextInt();

System.out.println( "Factorial of " + num + " is " + factorial(num));

    }

}

(B) A tool that I browsed and installed for the purpose of program slicing is CodeSurfer.

CodeSurfer is a tool that gives eases reading and understanding of code and also provides a variety of effects of the code and its effect.

There is one problem with this tool is that 100k lines of code is the upper bound. No integration with eclipse, visual studio, etc.


Related Solutions

The purpose of this assignment is to choose a compensation philosophy that is appropriate for a...
The purpose of this assignment is to choose a compensation philosophy that is appropriate for a life coaching firm and articulate a rationale for this selection. There are two aspects to this assignment. First, describe the risks and benefits of leading, meeting, and lagging the market in overall compensation and benefits. Next, choose the appropriate strategy (lead, meet, or lag) for your firm, and provide rationale about why this is appropriate. There is a minimum requirement of 500 words for...
The purpose of this assignment is to choose a compensation philosophy that is appropriate for a...
The purpose of this assignment is to choose a compensation philosophy that is appropriate for a life coaching firm and articulate a rationale for this selection. There are two aspects to this assignment. First, describe the risks and benefits with leading, meeting, and lagging the market in overall compensation and benefits. Next, choose the appropriate strategy (lead, meet, or lag) for your firm, and provide rationale about why this is appropriate. There is a minimum requirement of 500 words for...
Baye suggests some ways to assess markets. Choose any market that you’d like and assess the...
Baye suggests some ways to assess markets. Choose any market that you’d like and assess the concentration of firms and its impact on competition. ~1-2 pages.
(Q)Choose a DBMS that you’d like to use. Provide some evidences to show that you have...
(Q)Choose a DBMS that you’d like to use. Provide some evidences to show that you have some basic knowledge of the software. For instance, use the software to define a name and address database of your business associates, friends, classmates etc. You can use the following relation: (LAST NAME, FIRST NAME, SEX, ADDRESS, POSTCODE, CITY, PHONE). Enter at least five people in your data file. Print/screen shot a copy of the records. There should be no blank records. (20) please...
The purpose of this assignment is to allow the student an opportunity to explain what it...
The purpose of this assignment is to allow the student an opportunity to explain what it means to have an efficient capital market. Students will gain an understanding of the different levels of market efficiency and how behavioral finance can inhibit reaching market transparency. Explain in 525 words what it means to have efficient capital market, including: Describe the behavioral challenges in achieving efficiency. Discuss the three forms of market efficiency. What are the implications to corporate finance? Would you...
Assignment Purpose The purpose of this lab is to write a well commented java program that...
Assignment Purpose The purpose of this lab is to write a well commented java program that demonstrates the use of one dimensional arrays and methods.(Need Comment, Write by Java Code) Instructions Write a method rotateArray that is passed to an array, x, of integers (minimum 7 numbers) and an integer rotation count, n. x is an array filled with randomly generated integers between 1 and 100. The method creates a new array with the items of x moved forward by...
Assignment Purpose The purpose of this lab is to write a well commented java program that...
Assignment Purpose The purpose of this lab is to write a well commented java program that demonstrates the use and re-use of methods with input validation. Instructions It is quite interesting that most of us are likely to be able to read and comprehend words, even if the alphabets of these words are scrambled (two of them) given the fact that the first and last alphabets remain the same. For example, “I dn'ot gvie a dman for a man taht...
Assignment Purpose The purpose of this lab is to write a well commented java program that...
Assignment Purpose The purpose of this lab is to write a well commented java program that demonstrates the use of one dimensional arrays and methods. Instructions Write a method rotateArray that is passed to an array, x, of integers (minimum 7 numbers) and an integer rotation count, n. x is an array filled with randomly generated integers between 1 and 100. The method creates a new array with the items of x moved forward by n Elements that are rotated...
Assignment Purpose The purpose of this lab is to write a well commented java program that...
Assignment Purpose The purpose of this lab is to write a well commented java program that demonstrates the use of two dimensional arrays, input validation, and methods. (Write by Java Code, Need Comment) Instructions A theater seating chart is implemented as a two-dimensional array of ticket prices, like this: Seat Ticket Price 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10...
Assignment Purpose The purpose of this lab is to write a well commented java program that...
Assignment Purpose The purpose of this lab is to write a well commented java program that demonstrates the use of one dimensional arrays and methods. Instructions Write a method rotateArray that is passed to an array, x, of integers (minimum 7 numbers) and an integer rotation count, n. x is an array filled with randomly generated integers between 1 and 100. The method creates a new array with the items of x moved forward by n Elements that are rotated...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT