FIT9131 - Programming foundations in Java Assignment

Assignment Help JAVA Programming
Reference no: EM132391653

FIT9131 - Programming foundations in Java Assignment - 256 With Arraylists, Monash University, Australia

The assignment must be done using the BlueJ environment.

The Java source code for this assignment must be implemented according to the Java Coding Standards for this unit.

Completion of this assignment contributes towards the following learning outcomes:

1. Design, construct, test and document small computer programs using Java;

2. Interpret and demonstrate software engineering principles of maintainability, readability, and modularisation;

3. Explain and apply the concepts of the "object-oriented" style of programming.

Specification -

In this assignment you will write a program to play the game of 256 With Arraylists. The objective of the game is for the player to keep adding three randomly provided multiples of a number, to attempt to get the total score of 256 or higher. The game is a modified version which allows the player to use up to two arraylists as buffers which can be used to store the numbers and retrieve the numbers. This section specifies the required functionality of the program. Only a text interface is required for this program; however, more marks will be gained for a game that is easy to follow with clear information and error messages to the player.

256 With Arraylists (D Level Assignment) -

The game begins with the program reading the allowed multiples from a file called "multiples.txt". (This file is available on moodle). The file will only contain ONE set of mutliples. These are the three numbers which will be randomly provided to the user during the game. For e.g. 2, 4, and 8. The game will operate using one arraylist as a buffer instead of a grid. The maximum number of elements which can be stored in the arraylist is 5. Below is a depiction on the game layout (for illustration only):

The game sequence is as follows:

1. The game starts by registering a player to play the game.

2. The Arraylist buffer (b1) is empty.

3. The game then provides a random multiple to the player which is stored in the game total from the available multiples.

4. The player can then perform the following actions:

Split:

  • This allows the player to move the number from the game total (t) and add it to the arraylist buffer (b1).
  • A new random multiple is then generated and put in the game total (t)
  • The game then continues from point 3 above.

Merge:

  • This allows the player to merge the number in the game total box with a matching number in the arraylist at any position. The total is then put in the game total box and the number which is added is then removed from the arraylist.
  • After the total is added, the game total (t) now shows the new number. No new random number is generated and the game goes back to point 4 above to allow the player to continue.

5. The game ends when either of the following occur:

  • The game total (t) reaches the total of 256 or higher.
  • The arraylist buffer (b1) has reached the maximum limit of 5 numbers and no more numbers can be stored and none of the existing numbers can be merged to the game total (t).

At the end of the game, the program will write the final outcome to the file "outcome.txt" which will show the player name and the highest score achieved.

256 With Arraylists (HD Level Assignment) -

The game begins with the program reading the allowed multiples from a file called "multiples.txt". (This file is available on moodle). The file will only contain MANY sets of mutliples. The user can choose which multiple they would like to use when playing the game. These are the three numbers which will be randomly provided to the user during the game. The game will operate using TWO arraylist as buffers instead of a grid. The maximum number of elements which can be stored in thefirst arraylist is 5. The maximum number of elements which can be stored in the second arraylist is 3. The game also allows the user to set the game total up to which the game will be played. Below is a depiction on the game layout.

The game sequence is as follows:

1. The game starts by registering a player to play the game.

2. The player is prompted to enter the game total upto which the game will be played. The game total must be greater than 32 and a multiple of 8.

3. The player is then prompted to select from the possible list of multiple with which to play the game. (These have been read from the file).

4. Both the Arraylist buffers (b1 and b2) are empty.

5. The game then provides a random multiple to the player which is stored in the game total.

6. The player can then perform the following actions:

Split Right

  • This allows the player to add the game total (t) number to the right arraylist buffer (b2)
  • A new random multiple is then generated and put in the game total (t)
  • The game then continues from point 5 above.

Merge Right

  • This allows the player to merge the number in the game total box with a matching number in any position in the right arraylist buffer. The total is then put in the game total box and the number is removed from the arraylist.
  • After the total is added, the game total (t) now shows the new number. No new random number is generated and the game goes back to point 6 above to allow the player to continue.

Split Left

  • This allows the player to add the game total (t) number to the left arraylist buffer (b1)
  • A new random multiple is then generated and put in the game total (t)
  • The game then continues from point 5 above.

Merge Left

  • This allows the player to merge the number in the game total box with a matching number in any position in the left arraylist buffer. The total is then put in the game total box and the number is removed from the arraylist.
  • After the total is added, the game total (t) now shows the new number. No new random number is generated and the game goes back to point 6 above to allow the player to continue.

7. The game ends when either of the following occur:

  • The game total (t) reaches the total of whatever the user entered in point 2 above or higher.
  • The arraylist buffers (b1 and b2) have reached the maximum size limit allowed (depending on the difficulty level) and no more numbers can be stored and none of the existing numbers can be merged to the game total (t).

At the end of the game, the program will write the final outcome to the file "outcome.txt" which will show the player name and the highest score achieved.

The following are some of the requirements for the game:

  • Player name must be between 3 and 10 characters, cannot be blank and cannot contain only spaces.
  • The arraylist buffers will not allow more elements to be stored beyond the assigned size limit (defined by the difficulty level).

Requirements - You MUST show your tutor the D level version of the assignment prior to submitting the HD Level. To do so, you may make a copy of your D level assignment which can be shown to your tutor during your scheduled tutorial.

Program design - Your program must consist of at least the following classes: Game, Buffer, Multiple, and RNG. A more scalable design with additional support classes which can be reused will get more marks. The following is the proposed class diagram for the program. The remainder of this section gives details of these classes. There are suggested fields for each class. If you include any extra fields then you must be able to justify these. You may want to include comments in your program to state any assumptions made.

Note - Do this assignment completely adhering to the requirements! And develop a test strategy for the buffer class.

Attachment:- Programming foundations in Java Assignment File.rar

Reference no: EM132391653

Questions Cloud

Two basic types of studies categorized : The two basic types of studies categorized as descriptive research include:
How does consumer behavior affect : How does consumer behavior affect all products in the product lifecycle?
What are the advantages and disadvantages smts : Many have strong views on self-managed teams (SMTs) - they are either perceived as great resources or viewed as a complete waste of time and detrimental.
Leadership skills needed in the emerging healthcare system : Discuss at least three of your personal leadership characteristics and evaluate their fit with the leadership skills needed in the emerging healthcare system.
FIT9131 - Programming foundations in Java Assignment : FIT9131 - Programming foundations in Java Assignment - 256 With Arraylists, Assessment Help and Solution, Monash University, Australia
Developing teamwork and internal quality using given details : For the Module 2 Milestone assignment, you will develop strategy that will target processes for developing, to include steps for evolving into productive.
Mission of is to develop not only scholar-practitioners : The mission of is to develop not only scholar-practitioners, but also to foster positive social change. Explain how your research might effect social change.
How employee branding can increase brand identification : In the article regarding employee branding found in Piehler, King, Burmann, & Xiong (2016) the four internal brand management (IBM) are measured and a model.
When you caught yourself falling into confirmation bias : Describe an example that happened lately when you caught yourself falling into confirmation bias but after all ended up correcting yourself.

Reviews

len2391653

10/23/2019 9:46:45 PM

I need someone to do this assignment completely adhering to the requirements! and to develop a test strategy for the buffer class. Hints and Suggestions - Your assignment may want to use pass by reference to achieve a well-designed program. Additionally, should your program wish to accept only String inputs from the user, you may want to look up the Integer.parseInt() method which belongs to the Integer class. This can be used along with exception handling to ensure your program doesn’t crash. The new random number is only generated, IF the value for user choose to Split the value (i.e. move it to the array list).

Write a Review

JAVA Programming Questions & Answers

  Short assignment with the try- catch error handling

This is a short assignment with the try- catch error handling files with exceptions that need to be caught locally in the program, Also it needs to be done in

  Write a program to register students for a college

Students have names, addresses and courses. Implement the interface class RegisterStudent. RegisterStudent has one method, public boolean register, which returns the boolean value of true or false if the student is successfully registered for the ..

  Write program that prompts the user to enter the first digit

Write a program that prompts the user to enter the first 9 digits and displays the 10 digit ISBN( including leading zeros) . Your probram should read the input

  Have the function signatures link to a good page

CS3270 – Advanced Web Programming - Bemidji state university - Have the function signatures link to a good page on the internet explaining that function's use.

  Create a class representing a student

Create a second class that instantiates the first class with information about yourself. In the second class, create a class method that displays your name and GPA.

  Create method called left that accepts a array of characters

Create a method called left that accepts an array of characters and the number of characters to return.

  Create appropriate packages for all classes

Requirements listed using Java programming code only. You must use the concepts we work on in class. All code must be fully commented

  Create a java program

UserApp and PrettyPrintUtility multiple times (supplying different TransData test file names), the AutoTesterUtility PROGRAM will be the driver program.

  Create a program that can find prime factors of an integer

Create a standalone Java program that can find the prime factors of an integer. Use the Java BigInteger class rather than an int type or the Integer type to all

  Identify the first character of the name and lengthof length

Write a Java application that stores the names of your family and friends in a one-dimensional array of Strings. The program should show all names in upper case and lower case, identify the first character of the name, and the lengths of the names.

  Print out and display a month object properly

Print out and display a Month object properly, which is a 2d array. After I can do this, I need to make an array of month objects, and print them out line

  What is a character class in a pattern

What is a character class in a pattern? What are the predefined character classes, and what do they mean? What are symbolic quantifiers, and what do they mean?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd