Get Instant Help From 5000+ Experts For
question

Writing: Get your essay and assignment written from scratch by PhD expert

Rewriting: Paraphrase or rewrite your friend's essay with similar meaning at reduced cost

Editing:Proofread your work by experts and improve grade at Lowest cost

And Improve Your Grades
myassignmenthelp.com
loader
Phone no. Missing!

Enter phone no. to receive critical updates and urgent messages !

Attach file

Error goes here

Files Missing!

Please upload all relevant files for quick & complete assistance.

Guaranteed Higher Grade!
Free Quote
wave
Assignment 1: Design and Test a Class
Answered

Assignment Objectives

This assignment counts 20% towards your module mark.


The deadline for submitting your work via Blackboard 

To demonstrate your ability and understanding in the following tasks:


1. To design and implement a simple class.


2. To write a test program to create instances of your class and demonstrate its behaviour.


3. To collect output from the test program runs, and comment on it.


4. To conform to Java coding conventions, including documentation style comments.

You must create a general design for a class. Design, implement, test and document this class. You will need to make some assumptions and design decisions about the class. Ensure the class documentation makes the purpose and constraints of you class clear. You should strive to write your class so that it is potentially useful in other applications.

Pass (50 - 59): You have produced a class with appropriate fields, a constructor, and some modifier and accessor methods. There is a javadoc header describing the class. A test program creates an instance of the class and uses some methods. The code is suitably formatted, syntactically correct, and the test program executes, and output has been recorded.


Merit (60 - 69): Criteria for a Pass have been met. In addition, all standard naming and coding conventions have been met. There has been consideration of class design, which is evidenced by javadoc comments, programmer comments, or the report. There is an appropriate level of documentation throughout the class. All constructors and methods have been used in the test program. The report gives an insight into the design and implementation decisions.


Distinction (70+): Criteria for a Merit have been met. In addition, code style and documentation is to a professional standard. The class design is appropriate for the given scenario.  Implementation is (almost) all correct and maintains the integrity of attributes where appropriate. The test program thoroughly exercises the methods and exposes any limitations, in addition to using an ArrayList.

Design, implement, and test ONE of the classes described below or specify your own. The class descriptions are deliberately vague in places. For your chosen class, you should use Javadoc comments to specify its purpose, properties and scope making appropriate assumptions where necessary. Additional note: To receive higher marks, in your test class you should aim to sensibly utilise an ArrayList, an overridden equals method, and the Scanner / PrintWriter for I/O.


Classes marked with (60) or (80) are simpler than others and therefore can achieve at best those respective marks. You are strongly advised to attempt a (80) or (100) level class. Your tutor will indicate the level of complexity of any class you specify and you MUST get your tutors permission. You CANNOT use any class that has been discussed or provided to you during this module.

Class

Brief Description

AddressName (60)

An address has a house number, a street name, a town, county and postcode. This class should return the full address formatted appropriately.

EmailAddress (60)

An email address is made up of a real name, a user id and domain, e.g. Peter Jones <[email protected]>. The class should return a correctly formatted email address.

Clock (80)

Models a 24 hour clock, which stores a time as hours and minutes. The time can be advanced. The client can retrieve the hours and minutes.

FilmRental (80)

A film DVD has a film title, duration, and category (e.g. U, PG, 15A). The DVD can be rented and returned.

ScreenRobot (80)

A robot has a (x, y) coordinate location. It can turn 90 degrees and move forward by some amount. It can go ‘home’ to its origin.

CinemaBooking (80)

A cinema booking can be for a number of adults and children. The child’s ticket price is half of the adult. The cost of the booking can be retrieved.

TaxiJourney (100)

A taxi journey has a start location and a destination. There is an estimated duration of journey and distance. The class should work out the fare based on a formula using the duration and distance (you can make up a suitable formula).

HealthMonitor (100)

A monitor can be used for a variety of purposes: heart beat, temperature, blood pressure. A monitor has a minimum and maximum value. If the current reading goes out of the expected range then an alarm is set.

Stocklevel (100)

A product in a shop has a particular quantity in stock. The is a minimum stock level, and when this is reached it indicates that the product needs to be reordered. Each item has a suggested reorder amount.

Your own idea (?)

. . . discuss with tutor first . . . Grade will be decided by your Tutor.

This may include taking an existing class such as Clock or ScreenRobot and agreeing some more advanced behaviour.

support
close