FIT1051 Instructions 3

FIT1051 S1 2022 – Ed Lessons N
This course has been archived
Lessons Slides Prev Next
Assessment #3
Assessment #3
Submission deadline: 24th April 2022 11:59pm AEST via Moodle
Instruction
Below are the coding tasks that you need to complete individually for assessment 3. You should download the IntelliJ project folder as below and unzip it. Then work on the tasks in the project folder.
Assessment3.zip
This assessment is worth 18% of the unit total. It contains 100 marks, which has two components.
Task correctness weighted 100 and will be converted to 90 marks.
Task 1 has 15 marks Task 2 has 6 marks Task 3 has 12 marks Task 4 has 22 marks Task 5 has 20 marks Task 6 has 11 marks Task 7 has 14 marks
Code readability & documentation has 5 marks. Code development has 5 marks.
Academic Integrity
Please be reminded of the academic integrity mentioned in Week 01. You should code alone and ask the unit sta for help. Do not post your code in public forums.
Task 1 (W5 – 15 marks)
Code the following in Task 1 to demonstrate side eects in methods. Briey explain step by step how side eect occur to reference types but not to value types as inline comment.
Code a calling method that declares an array of double type and initialised with 5 sensible values. Call task1b method (called) in task1a method (calling). Display your array before and after to prove side eect has taken place for reference types but not to value types.
Code a called method that takes two parameters, an array of double as reference type and a double value. In the method, manipulate the argument by incrementing the value of the array. Note that you are not required to manipulate the entire array.
Task 2 (W5 – 6 marks)
Code in task2() method as below. Using the String format method just once, display the integer values 1, 10, 100, 1000 each on its own line right justied. The values must not be hard-coded. Example of the output as below.
Hints: Inserting the character sequence \n in a String embeds a ‘line feed’ (new line – similar to pressing ENTER when typing words in Notepad) in the string e.g. “ line1\nline2 “
Task 3 (W5 – 12 marks)
Code in task3() method by implementing the following sequence using ArrayList.
1. Declare an array list named myList which has the capacity of 10.
2. Add the following numbers: “one”, “seven”, “ve”, “three”, “eight”, “ten”. 3. Insert the value “eleven” in between “ve” and “three”.
4. Print all the elements in the myList
5. Delete the second last element in the myList
6. Print true if myList contains “seven”; false otherwise.
Note: Your code should use the appropriate data types.
Task 4 (W6 – 22 marks)
Code a private method called gradeScale that takes in a parameter mark as a String. The mark should be converted to appropriate data types using Java Class libraries and evaluate as below grading scale. If the mark is not within the range, it should return an appropriate error message to the user and vice versa. The method code should use the appropriate selection control structure and the conditions must demonstrate mutually exclusive and collectively exhaustive. The method should only use one return statement.
Example of output:
gradeScale(“80”) will return “” High Distinction ” in terminal
Task 5 (W6 – 20 marks)
Code a private method called daysOfTheWeek that takes in a parameter day as a String. Based on the input argument, the method should return the appropriate day (eg. Monday, Tuesday…etc) using a “switch case” control structure. If the day is not within the range, it should return an appropriate error message to the user and vice versa. The code conditions should demonstrate mutually exclusive and collectively exhaustive. The method should only use one return statement.
Example of output:
daysOfTheWeek(“2″) will return ” Tuesday ” in terminal
Task 6 (W7 – 11 marks)
Code in task6() method that display the radius which is integer and the ratio of area to circumference (perimeter of a circle) which are double for all circles with integer radii beginning with a radius of 1 and continuing while the ratio is less than 30 (exclusive). All variables should be declared with appropriate data types and initialised with sensible values. The code should use appropriate repetition control structure.
Hint: The Math Class in Java Libraries has methods that gives the value of π and power.
Task 7 (W7 – 14 marks)
Code in task7() method by drawing a CROSS (X), with its width (horizontal length) dened by the variable below: int size = 5;
The shape should be dynamic (not hard-coded) where changing the value of the size variable will draw shapes of dierent sizes of CROSS (X). This shape should be drawn by printing * using for loop, with the result shown on the terminal. All variables should be declared with appropriate data types and initialised with sensible values.
for int size = 5 , this should produce:
for int size = 10 , this should produce:
Code Readability (5 marks)
Overall code submission must be well organised and very easy to follow included but not limited to code indentation, code consistency, eective use of whitespace etc.
Code Development & Documentation (5 marks)
Overall code submission demonstrates correct syntax usage and meaningful naming conventions.Code documentations/inline comments are thorough and in detail.
Submission Instruction

Code Help