Create your characters

Assignment Help JAVA Programming
Reference no: EM131208105

Programming Assignment - Summer Semester 2015-

Purpose-

To provide students with the opportunity to apply the knowledge acquired and skills developed. These include understanding of primitive data types and the concept of collections (in the form of arrays) as well as structured programming including sequence, selection and repetition. 

Learning Objectives-

In the process of this assessment task you will:

  • Identify and use the correct syntax of a common programming language (Java);
  • Describe program functionality based on analysis of a given program;
  • Recall and use typical programming constructs to analyse, design and implement simple software solutions; and
  • Demonstrate debugging and testing skills whilst writing code.

Understanding and Enhancement of a Simple Menu Driven Program

Application Overview

For this assignment you have been provided with incomplete starter code that you must understand, modify and add to. The system provided simulates the collection, modification and reporting of game characters. The game characters have a unique id created in the program and have a number of attributes including a health rating and a power value. The system is run within the Eclipse IDE and provides a menu through the IDE console. The user must enter a pre-defined number of game characters before any of the other functionality can be used. At present, the following menu items are working:

  • Create your characters;
  • Display formatted information of all characters;
  • Display a particular character;
  • Display total legs and power for all characters; and
  • Empower your character.

One function listed on the menu is not working:

  • Display entered information of all characters

You must write the code for the missing function. 

Additionally, there are some changes required to the existing code. These changes are required to demonstrate the variety of ways of dealing with sequencing, selection and repetition and also demonstrate your capabilities for understanding and changing the code. 

PART A - Code Comprehension

The sample code provided in the GameCharacters.java class should be used to answer the following questions. Familiarise yourself with the operation of the application by running it and choosing the working options - 1, 3, 4, 5, 6:

1. Identify in the code the way in which users interact with the program. Identify the object and list the lines of code where the object is used to receive information from the user. Also list the lines of code where the program sends output to the user. 

2. What is the purpose of the "\t" in some of the literal Strings presented in the code?

3. How many game characters can be entered for this system? How many attributes does each character have? Identify the three lines of code where this information is established.

4. Currently, if the user enters an incorrect menu selection, what happens? Explain why the error message is displayed and what method and line of code is responsible and why.

5. The method menuSystem() is replaced with the code below. What would be shown for option 3 - display formatted information of all characters - if you had not yet entered any data (menu Selection ==1)? Where did the information displayed come from?

6. Explain in your own words what is happening on each line of the method createCharacterCode(int x).

7.  After entering the required number of game characters, choose option 3 to display formatted information of all characters and complete the following table of variable values after executing each line of the method decodeCharacterCode(int _code, int _row). Use a _row value of 1 and if a variable is not defined at any stage, use the text 'not defined':

8.  Now change the value of the FACTOR constant to 1000. Compile and run the application entering another set of game characters and choose option 3 to display the information. The code and studentID are incorrect on the report. What has gone wrong?

9.  In the createCharacterCode(int x) method, line 212 has the operation almostCharacterCode = almostCharacterCode * FACTOR; What would happen if you changed the "*" to a "/"? What primitive data type is almostCharacterCode and what would a more appropriate data type be if you changed the "*" to a "/"?

10. In the displayCharacterDetails(int _a) method a switch statement has been used to assist in assembling the String that lists the attributes of each character. The break keyword is used in this switch statement. What would happen if the break statement was removed after the first case (line 297)? You should discuss what generally happens with a switch statement when you remove the break and what actually happened here from an application perspective. What java error occurs? 

11. When entering characters, how many times is the createCharacterCode(int x) method executed? In the method itself, the condition if (almostCharacterCode == 0) exists. What other variable could have been used instead of  almostCharacterCode to achieve the same outcome? 

12. Explain the purpose of the boolean variable finished in the addPowerToCharacter () method and how it is used.

PART B - Programming Requirements

1. Provide the code for the displayAllCharactersRaw () method. You are expected to just list what has been entered by the user in "raw" form as well as the generated character code without any interpretation (i.e. the data as stored in the two dimensional array). In your solution you must use nested for loops and the constants for array dimensions. You must also only have one print statement in the outer loop detailing the attributes for the current character. This is done by using a String and concatenating to it. Look at the charAttrs variable in the displayCharacterDetails(int _a) method for an example of this.

2. Add any functionality required to allow two new power types to be added. Hint: you do not need to write any new lines of code. The power types and their values should be unique to each student. 

3. In the createCharacters () method, change the while loop for obtaining the studentID to a priming read while loop. Look at your lecture notes for week 4 for information on this.

4. In the displayCharacterDetails(int _a) method, replace the switch statement with a series of if/else if combinations to achieve the same functionality.

5. In the displayTotalLegsAndPower() method replace the for loop with a while loop. Look at your lecture notes from week 5 for information about this.

6. In the obtainCharacterAttribute(String _introText, String[] _typesText, int _min, int _max) method change the while loop to a do while loop.

PART C - Testing

An important part of verifying what you have done is testing. As per your lecture notes from week 5 you should consider:

  • Ensuring that the program is what the client is asking for (you have to be both client and programmer here);
  • Testing the design of the program to check that it meets the requirements;
  • Desk checking the code written; and
  • Testing the implementation of the code.

When testing, you should be able to distinguish between syntax, runtime and logic errors. Syntax errors are expected to be eliminated before submission (Eclipse IDE helps with this). Runtime and Logic errors are also expected to be eliminated if sufficient testing has occurred. 

You should at this early stage satisfy yourself and provide evidence that any changes you have made in ART B work as they should and have not had any adverse impact on other components. As a minimum you should provide evidence of the output of the system and its various functions before the changes and evidence of this after the changes. It is suggested that you make use of tables to display the data and testing.

Attachment:- Assignment.zip

Reference no: EM131208105

Questions Cloud

Income statement would reflect the sale-leaseback : To raise operating funds, North American Courier Corporation sold its building on January 1, 2016, to an insurance company for $540,000 and immediately leased the building back. Prepare the appropriate entries for North American on January 1, 2016, t..
Positive and negative aspects of workplace conflict : What are the positive and negative aspects of workplace conflict? Share examples from your professional experience to illustrate your answers. What are some differences in conflict management between unionized and non-unionized settings? Describe ..
Topic of green purchasing : Write notes on the topic of green purchasing clearly showing all the concepts under it. let me know if you can handle this question please
Coaching for performance : In Sir John Whitmore text - 'Coaching for Performance', he mentioned that there are qualities that are common to all leaders. They are: Values, Vision, Authenticity, and Agility.
Create your characters : ITECH1000/5000: Programming Assignment 1 - Summer Semester 2015. At present, the following menu items are working: Create your characters; Display formatted information of all characters; Display a particular character
Negative aspects of workplace conflict : What are the positive and negative aspects of workplace conflict? Share examples from your professional experience to illustrate your answers. What are some differences in conflict management between unionized and non-unionized settings?
Research the bullwhip effect : Research the Bullwhip Effect and write a paper that describes it and explain why it is an important consideration in Supply Chain Management.
Determine the estimated units of sales of overall product : Data related to the expected sales of snowboards and skis for Winter Sports Inc. for the current year, which is typical of recent years, are as follows: Products Unit Selling Price Unit Variable Cost Sales Mix Snowboards $270 $180 30% Skis 470 220 70..
Break-even sales and cost-volume-profit chart : Last year, Gelbin Inc. had sales of $263,900, based on a unit selling price of $130. The variable cost per unit was $100, and fixed costs were $42,300. The maximum sales within Gelbin's relevant range are 2,500 units. Construct a cost-volume-profit c..

Reviews

len1208105

9/16/2016 12:46:57 AM

Provide a GameCharacters java file that includes the enhancements and changes required under PART B – Programming Requirements of this assignment. Please update the comments in the header to include your name and student id and the list the changes that you have made. Provide evidence of code comprehension skills by answering questions relating to the starting code provided; and Complete the analysis, design, implementation and debugging of a small program that is pre-dominantly procedural in nature. This assignment is an individual assignment and it should be completed by the individual student only. The final submission must be identifiably the work of the individual. To support this, you will be required to demonstrate your working code to your tutor in your tutorial class and explain a selection of your assignment answers.

Write a Review

JAVA Programming Questions & Answers

  Use either an array or a linked list

Use either an Array or a Linked List as an underlying data structure. Of course you need to create class Array or class LinedList in order to implement the methods like mergeSort(), merge(), etc

  What challenges in planning solution for programming problem

what are the three biggest challenges in planning and designing a solution for a programming problem? What can you do to overcome these challenges? How would you apply these techniques to the programs in this class?

  Write a java program that draws a square abcd

Write a java program that draws a square ABCD. The points A and B are arbitrarily specified by the user by clicking the mouse button. The orientation of the points should be counter-clockwise

  Requirementspig is a folk jeopardy dice game with simple

requirementspig is a folk jeopardy dice game with simple rules two players race to reach 100 points. each turn a player

  Define javascript and servlet

The web site must be built using one of these techniques. JavaScript and servlet

  Determine the type of moped

Write a driver class called MopedRental. This class should perform the following: asks the user to enter the size of the moped, the day of the week and the number of hours rented, creates the Moped object, based on the size, and displays the input..

  Design of client-server protocols

Design of client-server protocols by reviewing the implementation of one. And you can develop an even greater understanding by extending or updating that implementation.

  Program to get final grade that should not be alphabet

Write a program to get final grade that should not be alphabet (i.e. out of 1-100). Each student has to give 5 lab assignments which is maximum score of 20, 4 quiz competitions which is maximum score of 20,

  Java code with the concept of cryptograms

How to create a java code with the concept of cryptograms? if the text is long then how to use the frequency of occurrence of each character?

  Paging efficiency at run time

Why or why not? Is there anything that could be done to improve paging efficiency at run time?

  How many data items are within one standard deviation

How many data items are within One Standard Deviation - Generate a list of 100 values between 0 and 100 using the generator (int)(Math.random()*101).

  Teaching software componentization

Describe one way in which one could apply Java graphics in education. Provide one example of such use to support your response and analyze at least three commands that you would use in order to draw a bar chart. Provide a rationale for your respons..

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