Ask Computer Engineering Expert

Assignment: Structured Programming Using Procedural Languages

Project

For your second project, you are going to write a simple program. You are going to design game that has a "chip" that will move on the game's "board". Like the DotCom object we built in our Week Six Lab, the game will not have any graphical elements. Instead, the program will communicate to the user via the monitor what actions need to be done (i.e., the board must be imagined by the user). After each action of the chip on the board, the program will respond if it was successful or not.

The size of the board in this game is 64 square locations. So, each side of the board has 8 rows of spaces we can place the chip. A visualization of the board and a chip:

Now, the only thing this chip is going to do is move around the board. The chip has rules about its movement and you will have to develop the algorithms to move the chip as described:

1. The chip will start by being "placed" on one location on the board (like above).

a. When being placed on the board, the new chip will need to know:

i. The number of total squares in the board.

ii. What horizontal row the chip is sitting in.

iii. What vertical row the chip is sitting in.

2. The chip may move in any direction on the board: horizontally, vertically, or diagonally.

a. When the chip moves in a vertical or horizontal direction, it moves 2 spaces in that direction.

b. When the chip moves in a diagonal direction, it moves 1 space in that direction.

3. The chip may not move off the board. If an attempt to move off the board occurs, the chip will move as far as it can and then stop at the board's edge.

4. Each time the chip moves, a message will be display to the screen (i.e.; System.out). There are two types of messages that will be displayed; if the move worked or if it bumped into an edge.

a. When a move is successful, the message "Good Move" will be displayed to the user.

b. When a move is not successful, the message will tell the user what edge of the board they bumped into.

i. "Hit left edge"

ii. "Hit right edge"

iii. "Hit top edge"

iv. "Hit bottom edge"

c. In addition to being displayed to the screen, the same message will also be returned to the method's caller (i.e., via a String object).

5. The chip will answer what row it is on for the horizonal or vertical direction when asked.

As you did in Project one, you are going to have to create a tester program to test out all the different algorithms you created in you class. But this time, you do not need to submit that program. I am only going to be assessing your "Chip" class for this project. Make sure you test out all the functionality that you design. I have my own tester program that is going to call your class. It will test out all the functionality requested when I am grading.

Just to reiterate what I have said, there are going to be many ways to solve this problem. That is fine and expected. We all see things within our environment differently, and that characteristic is more of a benefit in a team of programmers, than a negative.

Do not wait to start this assignment. This might seem simple on the surface, but there is a lot of conditional decisions to make it work as described. Spend time to map it out before doing to much coding of the process.

What to turn in:

1. A digital copy of your Java source code (submitted via Sakai as an attachment). For this first assignment, please submit the source code for the class you created. You can attach the file you created to Sakai. You also can place it in a zip file if you wish. Please do not submit your source code pasted in a Word document. Text files only (.java or .txt).

Attachment:- Project.rar

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92755882

Have any Question?


Related Questions in Computer Engineering

Does bmw have a guided missile corporate culture and

Does BMW have a guided missile corporate culture, and incubator corporate culture, a family corporate culture, or an Eiffel tower corporate culture?

Rebecca borrows 10000 at 18 compounded annually she pays

Rebecca borrows $10,000 at 18% compounded annually. She pays off the loan over a 5-year period with annual payments, starting at year 1. Each successive payment is $700 greater than the previous payment. (a) How much was ...

Jeff decides to start saving some money from this upcoming

Jeff decides to start saving some money from this upcoming month onwards. He decides to save only $500 at first, but each month he will increase the amount invested by $100. He will do it for 60 months (including the fir ...

Suppose you make 30 annual investments in a fund that pays

Suppose you make 30 annual investments in a fund that pays 6% compounded annually. If your first deposit is $7,500 and each successive deposit is 6% greater than the preceding deposit, how much will be in the fund immedi ...

Question -under what circumstances is it ethical if ever to

Question :- Under what circumstances is it ethical, if ever, to use consumer information in marketing research? Explain why you consider it ethical or unethical.

What are the differences between four types of economics

What are the differences between four types of economics evaluations and their differences with other two (budget impact analysis (BIA) and cost of illness (COI) studies)?

What type of economic system does norway have explain some

What type of economic system does Norway have? Explain some of the benefits of this system to the country and some of the drawbacks,

Among the who imf and wto which of these governmental

Among the WHO, IMF, and WTO, which of these governmental institutions do you feel has most profoundly shaped healthcare outcomes in low-income countries and why? Please support your reasons with examples and research/doc ...

A real estate developer will build two different types of

A real estate developer will build two different types of apartments in a residential area: one- bedroom apartments and two-bedroom apartments. In addition, the developer will build either a swimming pool or a tennis cou ...

Question what some of the reasons that evolutionary models

Question : What some of the reasons that evolutionary models are considered by many to be the best approach to software development. The response must be typed, single spaced, must be in times new roman font (size 12) an ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As