Objective: To be able to design a class by inheriting properties from another class.

Problem Description: Given a robot that can collect unwanted newspapers from different locations, the idea is to design and program this very simple robot. Let’s call this robot Pecky.

Pecky’s class definition should contain the following information:

– member variables: they should capture Pecky’s location (x coordinate, y coordinate) in the map; a bag where Pecky stores the collected newspapers. The map coordinates can be double or integer type. While the bag should be an integer type variable that would increase everytime Pecky collects a newspaper and decrease everytime Pecky drops a newspaper.

– constructors: it is optional to include the default one. But you need to add one that would create a version of Pecky and place it on a desired location at the map and with an initial number of newspapers in the bag to begin with.

– appropriate getters and setters.

– other methods: provide the following methods –

a. pickUpANewsPaper(): as soon as this method is called Pecky’s collector bag gets updated by adding one more newspaper.

b. dropANewsPaper(): as soon as this method is called Pecky’s collector bag gets updated by decreasing one newspaper.

c. move() : as soon as this method is called Pecky moves to a new location using the approach –

x_cor = x_cor + 1

y_cor = y_cor + 1

Once you have the class definition for Pecky ready, you should design a new type of Pecky, known as FastPecky, by inheriting from Pecky. The specialty of FastPeckyis that it can move very fast compared to a basic type of Pecky. Your job is to design a new move method that is appropriate for FastPecky.

Deliverables: a Java project consisting of three classes: Pecky.java, FastPecky.java and Robot.java (where the main method exists).

Found something interesting ?

• On-time delivery guarantee
• PhD-level professional writers
• Free Plagiarism Report

• 100% money-back guarantee
• Absolute Privacy & Confidentiality
• High Quality custom-written papers

Related Model Questions

Feel free to peruse our college and university model questions. If any our our assignment tasks interests you, click to place your order. Every paper is written by our professional essay writers from scratch to avoid plagiarism. We guarantee highest quality of work besides delivering your paper on time.

Grab your Discount!

25% Coupon Code: SAVE25
get 25% !!