1. Homepage
  2. Programming
  3. COMP5911M Advanced Software Engineering Coursework 1: Matrices and PictureAppPlus

COMP5911M Advanced Software Engineering Coursework 1: Matrices and PictureAppPlus

Engage in a Conversation
LeedsCOMP5911MAdvanced Software EngineeringJavaMatricesPictureAppPlus

COMP5911M Advanced Software Engineering Coursework 1 CourseNana.COM

This assessment is based on material from the lectures on refactoring and design patterns. There are two separate tasks, with a total of 100 marks available. Each task has multiple deliverables associated with it. You should submit all your deliverables using Gradescope (follow the link inside the Submit My Work folder in the modules Minerva page). CourseNana.COM

This assessment is worth 15% of your overall grade for this module. CourseNana.COM

Task 1 CourseNana.COM

A matrix is an array of numbers indexed by rows and columns. Matrices are widely used in computer graphics and numerical science. One common operation is to put a matrix into row echelon form, in which entries below the leading diagonal are set to zero. This is achieved by using the following algorithm. CourseNana.COM

Row Echelon Algorithm CourseNana.COM

  1. find left-most column with non-zero entry. CourseNana.COM

  2. if row with first non-zero element is not top swap the row with the top. CourseNana.COM

  3. add multiples of top row to make all values in column below top zero CourseNana.COM

  4. repeat the above for successive sub-matrices CourseNana.COM

The algorithm relies on two elementary row operations: CourseNana.COM

  1. swap two rows. CourseNana.COM

  2. add a multiple of one row to a second row. CourseNana.COM

Also, the ability to find the first non-zero element in a column, working down from the top must be provided. CourseNana.COM

The Task CourseNana.COM

A simple three by three matrix Java class has been written, with a method for converting the matrix to row echelon form. A Junit4 test suite has also been written that carries out two tests checking that the conversion is correct. CourseNana.COM

The row echelon function is currently a long loop with no decomposition into separate methods. Your task is to add three methods to the class, use them in the row echelon method, and add a test case to the testing class for each object, add a brief comment before each test in Javadoc format. The three methods are: CourseNana.COM

  1. swapRows: to swap a pair of rows. CourseNana.COM

  2. addMultipleOfRow: to add a multiple of one row to another. CourseNana.COM

  3. pivotIndex: to find the index of first non-zero element in a column, retuning -1 if all elements CourseNana.COM

    in the column are zero. CourseNana.COM

The Provided Code CourseNana.COM

You are provided with a zip archive holding the following items: CourseNana.COM

  • MatrixThreeThree.java source code for the matrix class CourseNana.COM

  • MatrixThreeThreeTests.java source code for the matrix test class CourseNana.COM

  • junit-platform-console-standalone-1.9.3.jar the Junit4 console test archive CourseNana.COM

    To compile and run you must have an up-to-date java and javac installed on the machine you are using. Open a terminal or console window and navigate to the directory holding the code. CourseNana.COM

    java -jar .\junit-platform-console-standalone-1.9.3.jar --class-path target --select-class MatrixThreeThreeTests CourseNana.COM

    The -jarflag tells the interpreter to run the program in the jar archive. The --class-pathflag tells junit to look in the directory 'target', and '--select-class' tell it which test class to run. CourseNana.COM

    You should see an output looking like this: CourseNana.COM

    Thanks for using JUnit! Support its development at https://junit.org/sponsoring CourseNana.COM

    ←[36m.←[0m
    ←[36m+
    --←[0m ←[36mJUnit Jupiter←[0m ←[32m[OK]←[0m ←[36m+--←[0m ←[36mJUnit Vintage←[0m ←[32m[OK]←[0m
    ←[36m| '
    --←[0m ←[36mMatrixThreeThreeTests←[0m ←[32m[OK]←[0m ←[36m| +--←[0m←[34mtestRowEchilonForm0←[0m←[32m[OK]←[0m ←[36m| '--←[0m←[34mtestRowEchilonForm1←[0m←[32m[OK]←[0m ←[36m'--←[0m ←[36mJUnit Platform Suite←[0m ←[32m[OK]←[0m CourseNana.COM

    Test run finished after 42 ms CourseNana.COM

Deliverables (to be submitted via Gradescope): CourseNana.COM

1.1 (35 marks) Your versions of the two java files: MatrixThreeThree.java and MatrixThreeThreeTests.java. CourseNana.COM

1.2 (15 marks) Brief report, maximum 500 words (matrices count as one word), acting as documentation for the three test functions. You are free to repeat or include the comment stings in the code if you wish. CourseNana.COM

Marking scheme: CourseNana.COM

1.1 Code: 10 marks for swapRows and associated test; 10 marks for addMultipleOfRow and associated test; and 15 for the pivotIndex and associated test. Marks will be deduced for submission of unmodified code, poor implementations of the proposed design, and the lack of descriptive comment on each function and test. CourseNana.COM

1.2 Report: 5 marks for each of the descriptions. Marks will be deducted for poor description of test. CourseNana.COM

Task 2 CourseNana.COM

In this task, you should extend the PictureApp we have discussed in the lecture. The extension is called PictureAppPlus, and just like its predecessor it displays a picture with a collection of shapes. I provided you the code of PictureAppPlus, which has the same functionality as the original PictureApp, but has been configured with a different window size and collection of shapes for this task. A snapshot of its user interface is shown below in Figure 1: CourseNana.COM

Figure 1 PictureAppPlus snapshot initial shape selection CourseNana.COM

The feature that must be added to PictureAppPlus is the ability to add shapes to any instance of the class Circle. Once a shape is added to an instance of Circle using the method add(Shape s), the added shape will be assigned the X and Y coordinates of the circle it was added into, and it should be drawn within the draw method of that circle. For example, the lines of code shown in Figure 2 below (from the provided PictureAppPlus class, some of which are commented out in the provided code) show a few shapes added to instances of Circle using the add method. Notice that the shapes added to an instance of Circle are not added to the instance of the class Picture. CourseNana.COM

Circle c1 = new Circle(150, 420, 90, Color.CYAN); picture.add(c1);
Circle c2 = new Circle(500, 185, 50, Color.MAGENTA); picture.add(c2); CourseNana.COM

Circle c3 = new Circle(450, 420, 60, Color.RED); picture.add(c3);
Circle c4 = new Circle(220, 70, 70, Color.WHITE); picture.add(c4); CourseNana.COM

Circle c5 = new Circle(0, 0, 42, Color.YELLOW); CourseNana.COM

c1.add(c5);
c2.add(new Triangle(0, 0, 30, 30, Color.ORANGE)); c3.add(new Rectangle(0, 0, 40, 40, Color.BLUE)); c4.add(new Rectangle(0, 0, 55, 20, Color.BLUE)); c5.add(new Triangle(0, 0, 18, 18, Color.RED)); CourseNana.COM

Figure 2 PictureAppPlus code excerpt CourseNana.COM

Figure 3 below shows all the shapes included in the provided PictureAppPlus class, including those added to circles (by uncommenting lines 46-53). Your task is to extend the provided code so the extended functionality of PictureAppPlus can be enabled. CourseNana.COM

Figure 3 PictureAppPlus snapshot showing circles containing other shapes CourseNana.COM

CourseNana.COM

There is a well known design pattern that can be useful for this particular problem. Your first task is to identify that design pattern, and decide the best way to apply it to the problem. Once you identified the pattern and decided your approach, create a UML class diagram showing all the PictureAppPlus classes, including all the provided classes as well as changes you performed and any classes, attributes, operations, and associations you may have created. Then, implement your changes and make sure your code can support the new feature described in this task. CourseNana.COM

Deliverables (to be submitted via Gradescope): CourseNana.COM

  1. 2.1  (15 marks) UML class diagram showing your proposed design. CourseNana.COM

  2. 2.2  (20 marks) Brief report describing your design decisions, your choice of the pattern, and CourseNana.COM

explaining how you applied the pattern to PictureAppPlus (i.e. which classes play which of the roles described in the pattern). Maximum length: 500 words. CourseNana.COM

2.3 (15 marks) Code of the classes you have changed or created. CourseNana.COM

Marking scheme: CourseNana.COM

2.1 15 marks for a correct UML class diagram describing a valid design of a solution to the problem; 10 marks for a UML class diagram missing minor elements of the design; 5 marks for a UML class diagram missing a major element of the design; 0 marks for UML diagrams failing to describe a valid design or for diagrams that are not valid UML class diagrams. CourseNana.COM

2.3 15 marks for correct and efficient implementations of the proposed design by extending the provided code. Only submit code of classes you have created or modified as part of your solution. Do not submit code of classes you did not modify. Marks will be deduced for unnecessary modifications, submission of unmodified code, and poor implementations of the proposed design. Your submitted code will be compiled along with the code of the classes you did not modify and all standard Java libraries, and only code that can be compiled successfully will be marked.  CourseNana.COM

Get in Touch with Our Experts

WeChat WeChat
Whatsapp WhatsApp
Leeds代写,COMP5911M代写,Advanced Software Engineering代写,Java代写,Matrices代写,PictureAppPlus代写,Leeds代编,COMP5911M代编,Advanced Software Engineering代编,Java代编,Matrices代编,PictureAppPlus代编,Leeds代考,COMP5911M代考,Advanced Software Engineering代考,Java代考,Matrices代考,PictureAppPlus代考,Leedshelp,COMP5911Mhelp,Advanced Software Engineeringhelp,Javahelp,Matriceshelp,PictureAppPlushelp,Leeds作业代写,COMP5911M作业代写,Advanced Software Engineering作业代写,Java作业代写,Matrices作业代写,PictureAppPlus作业代写,Leeds编程代写,COMP5911M编程代写,Advanced Software Engineering编程代写,Java编程代写,Matrices编程代写,PictureAppPlus编程代写,Leedsprogramming help,COMP5911Mprogramming help,Advanced Software Engineeringprogramming help,Javaprogramming help,Matricesprogramming help,PictureAppPlusprogramming help,Leedsassignment help,COMP5911Massignment help,Advanced Software Engineeringassignment help,Javaassignment help,Matricesassignment help,PictureAppPlusassignment help,Leedssolution,COMP5911Msolution,Advanced Software Engineeringsolution,Javasolution,Matricessolution,PictureAppPlussolution,