605.201 Mini-Project 1:Solved

30.00 $

Click Category Button to View Your Next Assignment | Homework

You'll get a download link with a: . zip solution files instantly, after Payment


5/5 - (3 votes)

Please do the following to complete this assignment.


The purpose of this project is to provide non-trivial practice in the use of Java programming constructs discussed from the beginning of the course through Module 05 and have a bit of fun doing it.

Resources Needed:

You will need a computer system with Java 8 or greater SE edition run-time and JDK.  You may optionally use a Java IDE for example NetBeans, Eclipse, etc.  However application builders are not allowed.

Submitted Files:

Design and Analysis:

This word-processed document is required to be written in APA style minus the Abstract section.  The file format can be ODT, PDF, DOC, or DOCX. The length of the document should be between 1.5 and 2 pages plus a reference section.  The following subjects should be discussed in this order:

  1. General program design. How is the program organized?  What major data structures were used?  How are commands processed?  How is the PacMan’s state maintained? Etc.  This section should take about ½ to 2/3 of the paper content.  Do not repeat the project specifications (assume the reader is knowledgeable of the project specifications).
  2. What alternative approaches were considered and why were they rejected?
  3. What did you learn from doing this project and what would you do differently?

Source file:

All Java source will be in a single text file containing a single public class which can be compiled and executed in a standard Java 8 or later SE environment.  Multiple methods can be used but all usercreated methods must be in a single Java public class contained in the single Java text file.

The format of the Java source must meet the general Java coding style guidelines discussed so far during the course.  Please use course office hours or contact the instructor directly if there are any coding style questions.

Submit file:

The submit file is to be a Zip file containing both your design and analysis document and your single Java source text file.  Name your Zip file MiniProject1_<Blackboard ID><Section Number> for example: MiniProject1_jdealjr182.zip (note with Windows the .zip extension is added automatically).


It is encouraged to discuss technical or small design parts of this project with your fellow students.

However the resulting design and implementation must be your own.  For example, it is acceptable to discuss different ways of maintaining the PacMan state but not detailed design or implementation information on processing the Move command.  When in doubt, ask during office hours or contact your instructor.

Program Specification:

  1. Create a new Java program which implements a simple PacMan-type text game which contains the following functionality:
    1. At program startup, constructs and displays a 2-dimensional grid using standard array(s) (no collection classes allowed) with the size dynamically specified by the user (X and Y sizes can be different). Places the PacMan in the upper-left corner of the grid facing left  All grid cells should have the empty cell character of ‘.’ except for the start position of the PacMan which will have the appropriate PacMan symbol (see below).  Also 8% of your grid (rounded down if necessary) should contain cookies randomly located on the grid except for the initial PacMan position.  The grid must be displayed after each command.
    2. Use these symbols for the grid:
      1. Cookie symbol – shows were cookies are in the grid (‘O’)
      2. Empty symbol – shows empty unvisited grid cells (‘.’) (dot)
      3. Visited symbol – shows grid cells where the PacMan has visited (‘ ‘) (space)
      4. PacMan symbol depends on the current PacMan facing direction.
        1. Left ‘>’
        2. Up ‘V’
        3. Right ‘<’
        4. Down ‘^’
      5. The following menu of commands must be provided and must be displayed when appropriate. The command number is what the user should enter to execute the command.  Just display the command number and text (ex. 1: Menu), not the explanation of what the command does:
        1. Menu – Display the menu of commands.
        2. Turn Left – turns the PacMan left (counter-clockwise) but the PacMan stays in its current location
          1. Current: up, new: left
          2. Current: right, new up
          3. Current: down, new right
          4. Current: left, new down
        3. Turn Right – turns the PacMan right (clockwise) but the PacMan stays in its current location
          1. Current: up, new: right
          2. Current: right, new down
          3. Current: down, new left
          4. Current: left, new up
        4. Move – Moves the PacMan one grid location in the facing direction if possible. Adds one to the count of move commands if successful or not.  If the move command is successful, the previous location is replaced with Visited Symbol (see above).  If the move command results in the PacMan moving to a cell where a cookie is located, the cookie is “eaten” and the number of cookies eaten is increased by one.
        5. Exit – exits the program displaying the game statistics of the number of total moves and the average number of moves per cookie obtained.
      6. The main processing cycle is the following:
        1. The grid must be displayed after each command showing the effects of the command. B) Optionally display the list of commands
        2. Display the grid
        3. Accept user input. Code will be provided for reading user input.
          1. If an invalid command number is entered, an appropriate error message should be displayed and the menu of commands and grid gets redisplayed. An invalid command does not count as a command in the statistics.
          2. Process the command and add one to the number of move commands entered if it is a move command.
          3. If the user enters the Exit command, the program will display the number of commands and the average number of commands per cookie.
          4. E) If the resulting move places the PacMan over a cookie, indicate the cookie was eaten and add one to the number of cookies eaten for the program statistics.
        4. Observe the PacMan demonstration for an example of one implementation.
        5. Create a compressed zipped folder containing your Design and Analysis document and your Java


source file.

  1. Submit your compressed zipped folder as directed by your instructor. Assessment:

60%                      70%                80%                   90%


100%                Weight

Design &                   Majority               All but one     All document    All                    All document    15%

Analysis                    document            document      subjects            document        subjects

Document              subjects subject            covered with   subjects           covered with covered with    covered           accurate          covered           insightful accurate      with    information.    with     and accurate information.      accurate          Maybe some    insightful         information.  Some fluff.        information     fluff.     and accurate   Document is Document is       .  Maybe          Document is    information.    of specified over half the   some fluff.       close to the     Document is    length and specified            Document       specified          of specified      properly

length with 2-4 is close to length with length with formatted to minor APA the 1-3 minor 1-3 minor APA style.

style or other     specified          APA style or     APA style minor issues.    length with      other minor     or other 2-4 minor    issues.  minor

APA style                                issues.

or other minor issues.

Program                    All but two           All but one     All but two        All but one       All specified      60%

Correctness              major specified    major             minor                minor              features work

features work      specified        specified           specified          with neat and

Note:                        but a noble          features         features            features           easy to

Compilation             effort is made.     work but a      work.  For         work.  For       understand

errors and      For example    noble effort     example the    example the    information warnings are part         the PacMan     is made.           PacMan           PacMan           display.  of this           will not move For       facing is not     facing is not evaluation.          up or down the          example          always always grid and the     the       correct or the  correct or PacMan can           PacMan           display of the  the display

move off the will not grid is a little of the grid is grid. move up or off. a little off.

down the grid or the

PacMan can move

off the grid.

Code Style                Most                    Most              Most                 Functionalit     Functionality     25%

functionality functionalit functionality y properly properly not properly y properly properly segmented segmented segmented into segmented segmented into into methods. methods.  into into methods. methods.  All variable Some variable methods.  Most Most use proper use proper Most variable use variable use names and names and variable proper names proper types.

types.  Some use proper and types.  names and Appropriate commenting. names and Appropriate types.  commenting. Some use types.  commenting. Appropriate Proper proper Some Mostly use commenting indentation indentation commentin proper .  Mostly line line g. Some indentation use proper continuation, use proper line indentation etc.

indentation                              line


If you have any questions about the specification of this project, contact your instructor before the project is due.

  • MiniProject01.zip