CSEOOF Semester XXXXXXXXXXAssignC OOF Assignment Part D - due: Tuesday, 22 October 2019, at 10.00 a.m. this is the first and final hand in date Page 1 of 9 Department of Computer Science and...

1 answer below »
its attatched


CSEOOF Semester 1 2019 AssignC OOF Assignment Part D - due: Tuesday, 22 October 2019, at 10.00 a.m. this is the first and final hand in date Page 1 of 9 Department of Computer Science and Information Technology La Trobe University CSE1OOF / CSE4OOF Semester 2, 2019 Assignment Part D Due Date: Tuesday, 22 October 2019, at 10.00 a.m. First and Final date for SUBMISSION Tuesday, 22 October 2019, at 10.00 a.m. Delays caused by computer downtime cannot be accepted as a valid reason for a late submission. Students must plan their work to allow for both scheduled and unscheduled downtime. There are NO EXTENSIONS on this assignment as execution test marking will begin on Wednesday, 23 October – in your normal lab (Week 12) This is an individual assignment. You are NOT permitted to work as a group when writing this assignment. Copying, Plagiarism: Plagiarism is the submission of somebody else’s work in a manner that gives the impression that the work is your own. The Department of Computer Science and Information Technology treats academic misconduct seriously. When it is detected, penalties are strictly imposed. Refer to the unit guide for further information and strategies you can use to avoid a charge of academic misconduct. All submissions will be electronically checked for plagiarism. Assessment Objectives:  to design programs that conform to given specifications  to practise combining multiple classes and methods into a whole program  to implement programs in Java. Submission Details: Full instructions on how to submit electronic copies of your source code files from your latcs8 account are given at the end. If you have not been able to complete a program that compiles and executes containing all functionality, then you should submit a program that compiles and executes with as much functionality as you have completed. (You may comment out code that does not compile.) Note you must submit electronic copies of your source code files using the submit command on latcs8. Ensure you submit all required files, one file at a time. For example, the file Vector.java would be submitted with the command: > submit OOF Vector.java PLEASE NOTE: While you are free to develop the code for this progress check on any operating system, your solution must run on the latcs8 system. Marking Scheme: This assignment is worth 10% of your final mark in this subject. Implementation (Execution of code) 100% You may be required to attend a viva voce (verbal explanation of your code) assessment (to be used as a weighting factor on the final mark). Do NOT use the LMS or EMAIL to submit your files, use latcs8 only OOF Assignment Part D - due: Tuesday, 22 October 2019, at 10.00 a.m. this is the first and final hand in date Page 2 of 9 Return of Mark sheets: The face to face execution test marking in the lab (Week 12) constitutes a return of the assignment mark. Please note carefully: The submit server will close at 10:00 am on Tuesday, 22 October 2019. After the submit server has closed, NO assignments can be accepted. Please make sure that you have submitted all your assignment files before the submit server closes. There can be NO extensions or exceptions, unless a request is made before the deadline using the following link, together with a medical certificate that certifies a medical condition. https://www.latrobe.edu.au/students/admin/forms/request-an-extension/request Your assignment will be marked in your normal lab from Wednesday, 23 October 2019. You should attend your assigned lab; however, any other lab will be ok. You may have the assignment marked later, as it is marked from the submit server, not from your student account. All OOF assignments are marked from the submit server, never from a student's account. Please make sure that you submit you assignment on time. If you need to arrange a time other than your normal lab, please email the lecturer Dr Tian Feng ([email protected]). https://www.latrobe.edu.au/students/admin/forms/request-an-extension/request OOF Assignment Part D - due: Tuesday, 22 October 2019, at 10.00 a.m. this is the first and final hand in date Page 3 of 9 Please also note carefully that whilst we encourage innovation and exploring java beyond what has been presented in the subject to date, above all, we encourage understanding. The assignment that follows can be solved using techniques that have been presented in lectures, lecture / workshops and labs so far. These are the techniques and knowledge that we will later be examining in the Real Time Test (20 marks) and the exam (50 marks). Code and techniques that are outside the material presented will not be examined, of course. You are free to implement the program below in any way, with one condition. Any assignment that uses code that is outside what has been presented to this point must be fully explained at the marking execution test. Not being able to fully explain code outside what has been presented in the subject so far will result in the assignment being awarded a mark of 0, regardless of the correctness of the program. Submitting an assignment with code outside what has been presented so far and not attending the marking execution test will result in an automatic mark of 0, regardless of the correctness of the submission. Unless stated, all attributes must have private as their access modifier. Any classes that have any non-private object attributes will result in the whole assignment mark being heavily reduced, up to and including, being awarded 0, regardless of the correctness of the program. This includes omitting access modifiers, which means that the object attributes have the java default access modifier package. Using code not taught in OOF - READ THIS Access Modifiers in objects OOF Assignment Part D - due: Tuesday, 22 October 2019, at 10.00 a.m. this is the first and final hand in date Page 4 of 9 Task 1: Vector In mathematics and physics, a vector is an element of a vector space. If the space is N dimensional, such a vector consists of N scalars. For example, the vector (0, 0) represents the origin point of a two-dimensional Euclidean space. Task 1 requires you to write a Java class for a simplified vector that handle integer scalars. To enable rapid development of the program, the following Java file is provided: Vector.java An object of Vector class has the following attributes: • values This is an integer array that stores a collection of input integers passed in a constructor. Note its access mode is protected. • size This is an integer that represents the size of values attribute, i.e. the number of input integers. Note its access mode is protected. Vector class has the following two overloaded constructors: • The first constructor has two parameters: an integer array that stores input integers passed by users, and an integer that represents a default value. It takes following actions: 1. If the integer array parameter is null or contains less than two elements, values attribute is initialised of length 2, and both elements inside are set to the default value parameter; otherwise, values attribute is initialised of the same length as the integer array parameter, and all elements in the integer array parameter are copied to values attribute. Note it is NOT allowed to assign the value of the integer array parameter to values attribute. (Recall that an array is an object, and its corresponding object variable holds a memory address) 2. size attribute is set to the actual length of integer attribute. • The second constructor has any number of integers as parameters for values attribute. It takes similar actions to what the first constructor does, with the default value parameter of zero (0). Note the second constructor is required to reuse the first constructor. (Recall what you have learned on the this keyword and varargs) Vector class has the following four methods: • toString This is a public overrided method, which has no parameters but returns a String to represent the information about the current object’s values attribute. For example, if the values attribute has elements {2, 2, 2, 2}, the returned String is “[ 2 2 2 2 ]”. • getValues This is a public method, which has no parameters but returns an integer array. Specially, it returns a copy of all elements in values attribute. Note it is NOT allowed to return values attribute here. (Recall private leakage) • getSize OOF Assignment Part D - due: Tuesday, 22 October 2019, at 10.00 a.m. this is the first and final hand in date Page 5 of 9 This is a public method, which has no parameters but returns an integer. Specially, it returns the value of size attribute. • main This is a public static method to test the class and has been provided already. Note it is NOT allowed to make any change on this method. If the class is correctly written, it is supposed to output following information: [ 0 0 ] [ 0 0 ] [ 1 2 ] [ 1 1 ] [ 4 5 6 ] [ 4 5 6 ] [ 4 5 6 ] Marking Requirement Task 1 is worth 40 mark in this assignment. Any of the following actions will lead to a
Answered Same DayOct 08, 2021CSE1OOFLa Trobe University

Answer To: CSEOOF Semester XXXXXXXXXXAssignC OOF Assignment Part D - due: Tuesday, 22 October 2019, at 10.00...

Arun Shankar answered on Oct 14 2021
145 Votes
// CSE1/4OOF Semester 2 2019 - Progress Check Test
import java.io.*;
import java.util.*;
public c
lass Vector
{
protected int[] values;
protected int size;
// two overloaded constructors
Vector(int[] arr, int b)
{
if((arr==null) || (arr.length<2))
{
values = new int[2];
values[0] = b;
values[1] = b;
size = 2;
}
else
{
values = new int[arr.length];
for(int i=0;i values[i] =...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here