300580 Programming Fundamentals Assignment

Assignment Help JAVA Programming
Reference no: EM132852517

300580 Programming Fundamentals - Western Sydney University

Problem Decomposition

Regular Problems

In every practical, depending on your previous level of programming experience you have a choice to either complete a set of regular problems (if you are less experienced) or just to complete the Bonus problem and skip all the regular problems (if you are more experienced). A summary of marks for all regular problems is equal to the mark obtained for completing the bonus problem. If you want to maximise your chances of getting a high mark - you may consider completing all regular problems as well as the bonus problem. In this case mark deductions obtained in the regular problems can be compensated by the bonus problem. Note, however, that even if you produce no mistakes in all solutions - you can't obtain more than the maximum number of points allocated for all regular problems combined (10 points in this practical).

Problem 1 - Playing Mini Pacman

In this problem Clara plays a simplified version of the Pacman game. She is positioned on top of the first of a long trail of leaves, ending in front of a tree (as shown in Figure 1.1). She must pick up all leaves and stop in front of the first tree she encounters (as shown in Figure 1.2).

The most important characteristics of your solution are:

• There must be no leaves after program stops running.
• Leaves must be removed in correct order starting with the leaf under Clara and ending with the leaf next to a tree.

1929_figure.jpg


Figure 1.1. Initial screen Figure 1.2. Final Screen

Your program should be generic enough to handle any combination of leaves located next to one another in any configuration. Example worlds supplied with this problem will help you to test your code.

Problem 2 - Fix Leaf Trail

Clara is interested in ancient Greek mythology. She has read a story about Theseus and Minotaur and decided to replicate it in her world. According to the original story, Theseus finds a way out of a labyrinth by using a ball of red thread that Theseus unrolled as he penetrated the labyrinth, which allowed him to find his way back out. You can read more about Theseus and Minotaur.

In Clara's world the labyrinth looks similar to Figure 2.1. Instead of unrolling the thread Clara must put leaves everywhere she goes as she is looking for a way out.

Unfortunately, there are some leaves that are already present in the labyrinth. Clara must ignore those and simply place the leaves in all cells on her path where no leaves are present.

1793_figure1.jpg

Figure 2.1. Initial screen Figure 2.2. Final Screen

In the labyrinth there is always a mushroom that represents the exit. Clara's objective is to walk to the mushroom and stop in front of it. Her way from the initial position to the mushroom must be marked with leaves as shown in Figure 2.2.

The labyrinth is always of such a kind that Clara is able to get to the mushroom by simply walking forward until she encounters a tree in front of her that blocks her way. When there is a tree blocking her way, she should turn left and continue walking. She would know that her objective is completed when Clara discovers that she is positioned in front of a mushroom ( mushroomFront() ). The result of executing your code should look similar to Figure 2.2.

Your solution must be generic and has to work with all supplied example worlds. This means that before submitting you must test your code with all supplied worlds and it must correctly work in all of those. You should also aim at making sure that the code would work with all similar worlds with similar properties (beyond the provided examples).

Problem 3 - Fixing Columns

Clara's world has been shattered by an earthquake and to avoid any further damage she must quickly repair it. In particular, Clara is to repair a set of arches where some of the stones (represented by leaves, of course) are missing from the columns supporting the arches, as shown in Figure 3.1.

Your program should work on the world shown in Figure 3.1, but it should be generic enough to handle any world that meets certain basic conditions as outlined at the end of this problem. There are several example worlds in the starter folder, and your program should work correctly with all of them.

When Clara is done, the missing stones in the columns should be replaced by leaves, so that the final picture resulting from the world shown above would look like Figure 3.2.

It is extremely important for this problem to only use the permitted commands as described in the header of the main file (MyClara.java). It is explicitly prohibited to use treeFront(), treeLeft() and treeRight() methods.

1214_figure2.jpg

Figure 3.1. Initial screen Figure 3.2. Final Screen

Clara may count on the following facts about the world:

• Clara starts at 1st Avenue and 1st Street, facing east, with an infinite number of leaves in her bag.

• The columns are exactly four units apart, on 1st, 5th, 9th avenue, and so forth.

• All columns are of the same height and are always exactly 7 units tall.

• Some of the corners in the column may already contain leaves representing stones that are still in place. Your program should not put a second leaf on these corners.
• Towards the end of the first street and immediately to the right of the last column there is always a mushroom that can be sensed using mushroomFront() method.
As usual, your code must be generic to deal with all supplied example worlds.

Bonus Problem

If you had previous programming experience - it is advisable to start with the bonus problem and see whether you can complete it. Students who didn't have prior programming experience should only attempt the bonus problem after completing the regular problems.

Problem 4 - Divide by Two

Clara starts in the world with a certain number of leaves randomly placed around the world as shown in Figure 4.1.

For every street in her world (if we assume that the number of leaves on this street is n) Clara must produce n/2 number of leaves on this street as shown in Figure 4.2. If the number of leaves on the street (n) happens to be an odd number, then Clara must round up the result to the nearest integer.

For example, if there were 5 leaves on some street originally then Clara must not produce 5/2 = 2.5 leaves (as she is unable to produce half a leaf), instead she must produce 3 leaves on this street.

It is important to have the correct number of leaves on every street, but their locations are not important.

2242_figure3.jpg

Figure 4.1. Initial screen Figure 4.2. Final Screen

IMPORTANT: You are explicitly prohibited to use for loops and variables for solving this problem.

Your solution must be generic and must work with all supplied example worlds. It should also work with any world of any size and any number of leaves on any street placed in any desired order. A good way to test that your solution is generic is to randomly shuffle the leaves around in the example worlds and run your code a few times with various combinations of leaves positioned at different streets and make sure it works correctly in every such world.

Attachment:- Programming Fundamentals.rar

Reference no: EM132852517

Questions Cloud

Find the value of the survival function of x : A continuous random variable X has the probability density function fX X given by f(x) = A - x/50 , 0 = x = 10.
ITC571 Emerging Technologies and Innovation Assignment : ITC571 Emerging Technologies and Innovation Assignment Help and Solution - Charles Sturt University, Australia - Assessment Writing Service
What is superman average rate : What is Superman's average rate? How far does Superman fly every 15 seconds? How close to Lois is Superman after 29 seconds?
Identify the population-parameter-sample and statistic : Identify the population, parameter, sample and statistic: A high school student was interested in finding the mean annual tuition at a 4-year US college.
300580 Programming Fundamentals Assignment : 300580 Programming Fundamentals Assignment Help and Solution, Western Sydney University - Assessment Writing Service
Ensuring the risk management process : Within a program, which of the following entities is responsible for ensuring the risk management (RM) process is executed according to the Program Risk Process
What is the test statistic : Researchers at the Mayo Clinic have studied the effect of sound levels on patient healing and have found a significant association (louder hospital ambient soun
Calculate the value of the test statistic : The Scottsdale fire department aims to respond to fire calls in 6 minutes or less, on average. Response times are normally distributed with a standard deviation
Explain different types of frequency distribution graphs : 1. Define frequency distribution and when is a frequency distribution table more beneficial to utilize.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

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