FIT1051 Assessment One


Hello, if you have any need, please feel free to consult us, this is my wechat: wx91due


FIT1051 Assessment One

Submission deadline: Friday 15th November 2024, 11:55pm MYT via Moodle

Weight: 12% of your overall unit mark

Late Penalty: 5% mark deduction per day

Instructions: Below are the coding tasks that you need to complete for Assessment 1. Your work and your submission should be independent. Please download the IntelliJ project folder below and unzip it. This will provide you with partial code in which to program your answers. Please complete each task in the appropriate section of the partial code, and submit to Moodle upon completion.

This assessment is worth 12% of the unit total. Submission of your code is worth 50% of this total, and your interview component (held in Week 5) is worth 50%.

The programming portion of this assessment contains 50 marks and is comprised of the following components:

Code correctness is worth 42 marks:

• Task 1 is worth 10 marks
• Task 2 is worth 16 marks
• Task 3 is worth 16 marks

Writing good quality code that adheres to the FIT1051 Coding Standards is worth 8 marks.

Academic Integrity: Please be reminded of the academic integrity standards that are expected of you at Monash, which were mentioned in Week 1. You should code alone and ask the unit staff for help if needed. Do not post your code in public forums or send your code to anyone. Do not copy/paste code from other sources and present it as your own — this includes use of generative AI tools. Breaching these academic integrity requirements can incur serious penalties.

Task 1: Playing with Input and Selection (10 marks)

In the Assessment1 class under task1() method, write code that does the following:

(a) Ask the user to enter 3 marks between 0-100, corresponding to 3 assessment items for a student. Give appropriate prompts to the user for the input. If the marks entered are more than 100, the program should report an error. [3 marks]
(b) Calculate the total marks out of 300 and the average marks for the student. [3 marks]
(c) Display the total mark and average marks to the screen along with their final grade. The grade Is based on their average marks and corresponds to: [4 marks]
  • 80 or more: High Distinction
  • 70 to 79: Distinction
  • 60 to 69: Credit
  • 50 to 59: Pass
  • 0 to 49: Fail
Task 2: Defining a Simple Class (16 marks)

(a) In the provided file Dice.java, create a new Dice class that represents a dice used in a game. It will have the following fields: [4 marks]

  • the number of sides (e.g.): 6 for a standard dice);
  • the value shown on the dice (e.g.): 2)

Choose appropriate data types for each fields.

(b) Now, create the following methods for the Dice class: [10 marks]
  • a 0-parameter (default) constructor, which assigns 6 sides and a random value between 1 and 6 to the dice using Random.
  • a parameterized (non-default) constructor that takes the number of sides as a parameter and rolls the dice to get a random value.
  • A method roll() that generates a new random value for the dice.
  • getter method for the value attribute
  • a toString() method that returns the value and the number of sides of the dice.

HINT: Note, the following code will generate a random number from 1-10 (inclusive): 

rand.nextInt(10) + 1;

You must also import the Random class by including the following line of code at the top of your program: 

import java.util.Random;

(c) Once you have created this class, in the Assessment1 class under the task2() method, write code that tests your class: [2 marks]
  • instantiates a Dice object, dice1, using the 0-parameter (default) constructor;
  • instantiates a Dice object, dice2, with a custom number of sides (e.g. 9)
  • Roll each dice and display their values using the toString() method

Task 3: Using the Dice Class for a Simple Dice Game (16 marks)

In this task we will simulate a very simple dice game. In the Assessment1 class under the task3() method, write code that does the following:
(a) Simulate 3 rounds of rolling a pair of dice for 2 players: [4 marks]
  • Instantiate 2 dice objects for each player using the 0-parameter (default) constructor
  • Roll both dice for each player using the roll() method.
  • Display the result of each player's dice roll after each round using the toString() method.
(b) Compare the dice values in each round: - [8 marks]
  • The player with a higher dice value wins the round.
  • A tie can happen during any of the rounds, and when there is a tie, use the Randomclass to break ties. Each player draws a random "luck" value between 1 and 10 to determine the winner of the round. The player who scores a higher "luck" value Isconsidered the winner for that round. If the dice value is same, then no points areawarded.
  • Award a point to the winner of each round based on their luck value if It's a tie.
Note: Loops are not required but may be used if appropriate.(c) After 3 rounds, display the final score and announce the winner of the game. [4 marks]

> Congratulations Player 1!! You won the game.

Adherence to coding standards [8 marks]

All code written should adhere to the guidelines set out in the FIT1051 Coding Standards.

Submission Instructions: Please submit your IntelliJ project folder as a .zip file and submit to the Assessment 1 link on the Moodle Assessments page as shown below. If you are not sure how to zip your project, please refer to the video here. MAKE SURE YOU DOWNLOAD FROM MOODLE AFTER THAT TO CHECK IT IS THE RIGHT SUBMISSION!

Interview component: You will be asked to demonstrate your program at an interview in Week 5, following the code submission date. You will be contacted by your TA regarding the interview and if you need to book a time.

The interview will be 10 minutes in length, and consist of 6 questions. You may be asked to explain your code, your program designs, to modify your code, to discuss your coding decisions, or to explain the any of the coding concepts taught in Weeks 1-4 that this Assessment covers.

Interviews will take place in person during Applied class time, and also online via Zoom. You must have access to a stable internet connection and a working webcam, and your webcam must be switched on for the duration of the interview. Interviews will be recorded for marking integrity purposes, and recordings will be deleted at the end of semester.

It is your responsibility to make yourself available for an interview time. The interview is worth 50% of your assessment mark, and any student who does not attend an interview will receive a fail grade for the assignment. Your interview must take place before the end of Week 5.

发表评论

电子邮件地址不会被公开。 必填项已用*标注