Ask Question, Ask an Expert

+1-415-315-9853

info@mywordsolution.com

Ask Java Expert


Home >> Java

problem 1) Assignment: PipeLayer

In this assignment you would explore use of inheritance and dynamic binding in Java.

You would be provided with the partial implementation of simple game program, written in Java. Your task is to complete the program.

The Lake Gaston Pipeline Game

Construction is underway on pipeline to bring water from Lake Gaston to thirsty Virginia Beach. You are lucky enough to have won contract to lay pipe through the small parcel of land. What's more, your brother-in-law lawyer has wrangled a wonderful contract under which you get paid per unit length of pipe which actually carries water, so it is in your best interest to snake that pipe back and forth as much as you can, so as to get the longest possible working pipeline within your small area of land.

Unfortunately, your pipe supplier delivers whatever shape pipe sections he feels like, and you have to pay for each one delivered, whether you use it or not. Could you lay more water-carrying pipe than you waste in unused pipe sections just lying around on your property?

To play game, follow the instructions below for running the program. At the top of the gameboard you would see the section of pipe which has been delivered. Click in the grid to place the pipe. If the pipe connects with water carrying pipe laid so far, the color would change to indicate that pipe is filling with water, and your score increases.

Running the game

To familiarize yourself with how program is supposed to work, you could run the completed version from the provided jar:

java -jar pipelayer.jar

The Assignment

Select a working directory for your assignment, ensure it is not world readable or executable. Copy the assignment files into that directory.
Files for this assignment are available here or, if you are logged in on our Linux system, at ~zeil/Assignments/cs330/pipelayer/.

Compile source code. (On the Linux system, you could use the provided makefile.

Run this version of the game, and compare to complete game you ran earlier.

As you would note in the previous step, the source code you have been given provides only a single shape of pipe.

You should complete the game, making it behave identically to complete game.

To do this, you must

a) modify PipeKit.java

b) add any extra source code files you wish

but you must not otherwise modify or remove other source code files provided.

If working on Linux, you might also find it to your advantage to modify the makefile by adding to list of CLASSES. For every file Foo.java which you add to the project, add name Foo.class to the CLASSES list in the makefile. [Note that all but the last line of the CLASSES list should end with a backslash \.]

Though, to appreciate how these classes get used in ways that exploit dynamic binding, look at the paint() function in Tile.java or the rescore() function in GameBoard.java.

Java, Programming

  • Category:- Java
  • Reference No.:- M94550

Have any Question? 


Related Questions in Java

Javapizzacontactlistat the beginning of all your programs

JavaPizza ContactList At the beginning of all your programs, put a comment box that includes the program name, your name, and a brief description of the program. Example: /************************************************ ...

Javacreating a new subclass of employee other types of

Java (Creating a New Subclass of Employee) Other types of Employees might include SalariedEmployees who get paid a fixed weekly salary, PieceWorkers who get paid by the number of pieces they produce or HourlyEmployees wh ...

The requirement is to design a system using jsp in

The requirement is to design a system using jsp in netbeans. You need to add other functions such as search by text, advance search, quantity update by admin, quantity check at the checkout, login and registering page, a ...

Write java program with eclipsinstructionswrite a program

Write java program with Eclips INSTRUCTIONS Write a program that will help a student practice basic math (addition, subtraction, multiplication, and division). Display a menu the student can select from. The student will ...

Write a java application using netbeans integrated

Write a Java application using NetBeans Integrated Development Environment (IDE) that calculates the total annual compensation of a salesperson. Consider the following factors: A salesperson will earn a fixed salary of 8 ...

Write a java application that allows a user to enter

Write a Java application that allows a user to enter numbers into an array and then process them. Enter the number of elements and the value of each element; Your application will process the data entered and will displa ...

Java programing essaywrite a paper of 700-word response to

JAVA programing essay Write a paper of 700-word response to the following: In your opinion, what are the three biggest challenges in planning and designing a solution for a programming problem? What can you do to overcom ...

Design your own java class that includes at least 3 data

Design your own Java Class that includes at least 3 data fields, 2 constructors and 4 methods. When designing your class, pick an object that you are familiar with and make it your own, realistic, yet simple design with ...

Java programmingscenario a mom and pop used car dealership

JAVA PROGRAMMING SCENARIO: A Mom and Pop used car dealership wants you to create a program that will manage their sales and inventory. They have provided a menu for you to follow. 1. Add To Inventory 2. Remove From Inven ...

Exam program create a class for working with mixed

Exam Program: Create a class for working with mixed fractions. Only 3 private data members are needed: the int whole number part of the fraction, the int numerator of the fraction, and the positive int denominator of the ...

  • 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

Section onea in an atwood machine suppose two objects of

SECTION ONE (a) In an Atwood Machine, suppose two objects of unequal mass are hung vertically over a frictionless

Part 1you work in hr for a company that operates a factory

Part 1: You work in HR for a company that operates a factory manufacturing fiberglass. There are several hundred empl

Details on advanced accounting paperthis paper is intended

DETAILS ON ADVANCED ACCOUNTING PAPER This paper is intended for students to apply the theoretical knowledge around ac

Create a provider database and related reports and queries

Create a provider database and related reports and queries to capture contact information for potential PC component pro

Describe what you learned about the impact of economic

Describe what you learned about the impact of economic, social, and demographic trends affecting the US labor environmen