Abc Assignment Help

ITECH2306 Agile Coding Assessment Answer


Learning Objectives:

The learning objectives for this lab assignment relate to knowledge and skills development:


K3Explain the object oriented principles of inheritance, polymorphism, encapsulation, dynamic binding and abstraction.

K4. Explain the principles of event-driven programming.


Develop object-oriented programs involving several interacting classes.

Develop, compile and debug code using an appropriate IDE

Manage multiple versions of source code.
Select appropriate ways to represent data.
Incorporate pre-written classes, including those from an API, into software solutions
Develop object oriented programs which incorporate event driven aspects.

Assessment Weighting

Each student is expected to work individually on this assignment and it will contribute 10% of your final mark. (Assessment items : Lab Assignment2 and Lab Assignment3)

Purpose and expectations

Each student is expected to work individually to complete this assignment.

By completing this assignment:

  • You will practise skills in reading a specification and developing functional requirements to inform your object oriented code design and development.
  • You will develop a multi-class system to meet functional specifications applying object oriented design principles.
  • You will use a GitHub repository to maintain your code.
  • Your development and design process will involve understanding UML class diagrams.
  • You will develop your understanding of and apply object-oriented programming techniques, in particular those relating to inheritance and abstract classes.
  • You will test your code using thoughtful test cases and write some Junit tests that can be run to test your code.

It is expected that each student will creatively design and author a system based on individual design choices that fit with the requirements listed in each task. Before you submit, read over the entire assignment and understand all the tasks.

All code must conform to stylistic standards including proper commenting, appropriate choice of identifier names (including case), proper indenting and other readability issues. If the code does not follow consistent style and formatting standards, marks will be deducted. For an example coding style guide, Consult


This assignment is due at the beginning of week 12 and each student must submit it individually in Moodle. All developed code should also be committed into the student’s GitHub repository in the GitHub Classroom. If there is no evidence of each student committing code regularly to GitHub, that student will be given zero marks. It is important there is evidence of each student contributing to the assignment.

Generally, each individual student must at a minimum (more details specified in next section):

  1. Author at least one Junit test class
  2. Write code to demonstrate overriding a method
  3. Identify polymorphic code
  4. Write code to read from a file
  5. Design and write event driven code through the use of swing
  6. Answer part B questions for the assignment

Each student must address the user requirements in the next section in their system.

System specification

This exercise requires you to access the GitHub Classroom and download some starter code, to review and extend that code and make multiple commits to save changes into an online source code repository in GitHub.

The following description outlines the user requirements that are to be addressed in the computer system that you develop. Where there is not enough information provided, you may make assumptions as long as you document these.

A computer ticketing system is under development and code is available for you to build upon. The ticketing system will produce tickets for rail travel between train stations. Each train station has a unique station number, a station name and a zone number in which it is registered.

Passengers will be able to use this ticketing system to create a ticket. Passengers pay for their ticket according to a particular fare type. Currently, 2 different fare types are available: FullFare, or Concession fare. A concession fare is charged with a discount of 10% off the regular FullFare.

The fare charged for a ticket is dependent on the service being used. Each service includes one or more zones travelled by the passenger for the trip. The seats available on the train services include first class seats and standard seats. Additionally, as there are potentially large distances, some services include a sleeper car so that passengers can purchase (for an additional fee ) a ticket entitling them to a berth in the sleeper car.

Stage 1:

You are provided with some incomplete code. Write some Junit tests to demonstrate that the code is working (or not)

  1. Author a number of Junit tests to establish that the ticket calculations are correct. The existing code needs further extension as follows:
  2. Change the existing code so that an ArrayList<Station> is used instead of the array of stations in the TrainService class.
  3. In the TrainService class, complete the setZonesTravelled method so that it calculates the number of zones travelled by a service. This calculation is based on taking the absolute value of the difference between the zone numbers of the departure and arrival station and adding one. For example:
    1. If a service departs in zone 1 and arrives in zone 4, then 4 zones are travelled.
    2. If a service departs in zone 7 and arrives in zone 1, then 7 zones are travelled.
    3. If a service departs in zone 1 and arrives in zone 7, then 7 zones are travelled.
    4. If a service departs in zone 3 and arrives in zone 7, then 5 zones are travelled.
  4. In the TrainService class, complete the methods: setArrivalStation and setDepartureStation so that these methods will each search for the given Station name in the ArrayList of stations and then set the appropriate station number for the service. Use a for each statement to iterate through the list of stations and check each station in the list to see if its name is equal to the name given. When you find the matching station, then you can save the found station and use a break statement to stop your for statement.
  5. Complete the getTicketPrice method in the TrainService class so that it calculates the ticket price for a service based on the number of zones travelled. If only one zone is travelled in, then the price is the MINTICKETPRICE. If multiple zones are travelled through by the service, then the price of a ticket is MINTICKETPRICE multiplied by the number of zones travelled.
    Station Number 
    Station Name 
    Zone Number 
    Station Number 
    Station Name
    Zone Number
  6. Author the method setUpData in the TrainService class that will read in all the station data from a text file using a Scanner object. The format of the file will have data on separate lines in the following pattern:
  7. Add a new method getTicketPrice in the SleeperService class to override the getTicketPrice in the TrainService Class. In this method, call the getTicketPrice from the superclass to find out the ticket price for this service and then add a surcharge of $50 for the sleeper service.
  8. Update the toString methods in FirstClassTicket and EconomyClassTicket so that they provide more information about the actual ticket – including the service being used and the fare type.
  9. Run your Junit tests again to check that the tickets are being created correctly.

Stage 2 :

Currently the system displays the following (incomplete) GUI:

system displays the following (incomplete) GUI

Complete the GUI to enable a passenger to purchase their ticket by selecting radio buttons for ticketing options including sleeper/standard car, first class or economy; and using radio buttons to select full fare ticket or concession ticket.

Passengers should also be able to select their train station for departure and arrival using drop down menus or checkboxes. When the user clicks the Purchase Ticket button, then a ticket should be issued (print to console or to a file) for a service from the departure station to the arrival station according to the current selections in the radio buttons.

Designing and Documenting your system

Create a document named: surnameStudentIDAssign1.doc. This is to be completed by each student individually. In your document, you must include the following section headings:

  • Authors,
  • System Overview,
  • Testing.
  • Answers to questions

System Overview

In the System Overview section you are to write 100-200 words describing your system and how it could be used in an imaginary use-case scenario. You will need to review this after completing all tasks and ensure that your overview explains your entire system. State any assumptions you make.


In this section of your documentation, you will describe your initial chosen test data and explain how that data proved that the code was correctly working. Make sure that you choose a variety of test cases to ensure you can be satisfied that your code is working. Describe your test cases and include screen shots of your testing results in this section.

Developing your system code

Use the following checklist to ensure you are following good practices:

  1. Include at least one constructor for each class
  2. Incorporate encapsulation into your design so that code (data attributes and methods) in each class only relate to the objects that will be instantiated
  3. Use information hiding approaches so that you clearly identify methods that should be public and you ensure that your variables are kept private within the class
  4. Where you have two or more objects that are associated, make sure you have used correct Java coding to implement this association
  5. You have appropriate get and set methods and a defined override of the toString method for each class
  6. You have added other additional methods where appropriate
  7. You have at least one example of a method or constructor that is overloaded
  8. You have at least one abstract class that is extended with specialisation sub classes
  9. You have at least one example of a method that is overriding another method
  10. You have a separate test driver class that has a text based menu providing options to demonstrate that your classes are working, including an option to run Junit test cases
  11. You have demonstrated understanding of iteration and selection in your code
  12. You have comments in your code naming the author of each class and describing code purpose and logic

 UML diagram shows the early system design

The above UML diagram shows the early system design before the GUI screen was added.

Part B Questions

Questions to be answered in your document (to be completed by each student individually)

Your lecturer/tutor may ask you some of these questions during your lab in order to assign these marks

For each requirement listed in the system specification (pages 2-3 of this document), explain the code that achieves this requirement – name the method and explain how it works to satisfy the requirement.

You are provided with a UML class diagram for the existing system. Using this diagram and also by reviewing the code provided, you are asked to answer the following questions with regard to your code:

  1. Give an example of a super class?
  2. Name a sub class and describe what inheritance means.
  3. Name a method that is overridden in a sub class.
  4. Identify where a super constructor is referred to in the code.

For each concept listed below, provide a description in your document and provide an explanation of the concept using an example to demonstrate from your submitted code.

  1. Overloading of a method or constructor
  2. Overriding of concrete methods in sub classes
  3. Abstract class
  4. Abstract method and overriding of an abstract method
  5. Information hiding and Encapsulation
  6. Identify where polymorphism exists in the code. Describe polymorphism.


For solution, connect with online professionals NOW!

Customer Testimonials