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

Program- java applet to practice multiplication with user

Program- Java Applet to Practice Multiplication with User Interaction 1) Develop a Java applet that will help an elementary school student learn multiplication. Use the Math.random method or a Random object to produce tw ...

Write a java program non-gui preferred to demonstrate the

Write a Java program (non-GUI preferred) to demonstrate the use of an ArrayList. The program should allow a user to do the following: Add, edit, delete different types of animals Select an animal, and the corresponding c ...

Spell checker in python and javawrite a python code and

Spell checker in python and java Write a python code and java code that can take a whole sentence and do text analysis by checking the spelling mistakes and show the correct spelling. Example: Input: I have a peen. Outpu ...

Assignmentproductjavacreate a class to encapsulate the data

Assignment Product.java Create a class to encapsulate the data and behavior of a product in a store's inventory. The class should have the following data for an inventory item: Product Number - String Description - Strin ...

Module assignment introduction to programming using

Module Assignment: Introduction to Programming Using Java This assignment is to provide practice using arrays and strings along with other Java programming techniques discussed so far in the course. For this assignment, ...

Assignmentexercise1write a java class that asks the user to

Assignment Exercise#1: Write a java class that asks the user to enter three numbers N1, N2, N3 , obtains the numbers, then calculates and displays the largest number Max followed by the text "is the largest" and the smal ...

Javawrite a program that finds and prints all the solutions

**java**write a program that finds and prints all the solutions to the N queens problem for a given N. At the end of your program, print how many solutions were found. What is the N-Queens problem, you ask? 1) Google it. ...

Java programmingwrite a java application using netbeans

JAVA PROGRAMMING 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 ...

Assignment 1overviewthis is an individual assignment that

Assignment 1 Overview This is an individual assignment that requires you to design, develop and test a small procedural Java program. Timelines and Expectations Learning Outcomes Assessed The following course learning ou ...

The taskyou must design and implement in java a bookshop

The Task You must design and implement in Java a Bookshop Management System corresponding to the attached scenario. You are not required to implement the entire scenario, but the more functionality your system has, the h ...

  • 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