logo Use CA10RAM to get 10%* Discount.
Order Nowlogo
(5/5)

Create a Java project using your IDE and name it using your name and your student ID

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

This TMA covers the first 7 sessions of M251. It is required to do the following:

 

Create a Java project using your IDE and name it using your name and your student ID

Implement all the required classes in the default package

Create a Word file contains the following:

o Answer of the given questions

o A copy (not a snapshot) of the code of each class

o A complete snapshot of the output

o If part of the code does not work, try to explain your idea

o The header of each page should contain your name and your student ID

On LMS page of M251, there are 2 links and you should submit 2 files (one file per link):

o The Word file you created

o A compressed file contains the folder of your Java project

 

Plagiarism Warning:

 

As per AOU rules and regulations, all students are required to submit their own TMA work and avoid plagiarism. The AOU has implemented sophisticated techniques for plagiarism detection. You must provide all references in case you use and quote another person's work in your TMA. You will be penalized for any act of plagiarism as per the AOU's rules and regulations.

 

Declaration of No Plagiarism by Student (to be signed and submitted by student with TMA work):

I hereby declare that this submitted TMA work is a result of my own efforts and I have not plagiarized any other person's work. I have provided all references of information that I have used and quoted in my TMA work.

Name of Student: Signature:

Date:

 

Overview:

 

National railway company wants to make a simple application to keep track of trips and passengers.

In this TMA, it is required to help the company implement the required application.

 

Requirements:

 

After a quick meeting with the employee in charge, you got the following information:

It is required to store the whole data in one collection

Each trip has a number, a driver and a specific date. In addition, passengers could be added or removed within a given limit for the maximum number of passengers who could be in the same trip. Furthermore, there are other attributes (add at least 3 attributes from your choice). Of course, trip number is unique within the same date.

Each driver has a unique ID, a name and other attributes (add at least 2 attributes from your choice).

Each passenger has a unique Civil ID (National ID), a name and other attributes (add at least 2 attributes from your choice but one of them should be common with drivers).

 

Moreover, you have been informed that the following operations happen frequently:

Offering a new trip

Adding a passenger to a specific trip

Removing a passenger from a specific trip

Retrieving the average number of passengers per trip of a specified date

Displaying all available trips in a format similar to the following: date1: tripNo1 tripNo2 tripNo3 …

date2: tripNo1 tripNo2 tripNo3 …

where dates and trips are sorted in ascending order

Saving all the data into a text file

 

Analysis:

 

Q1: There are common attributes and methods between passengers and drivers. What is the best choice for designing and writing the codes of these two classes? Explain your answer.

Q2: Draw a simple class diagram showing only relationships between the classes.

 

Implementation:

 

After analysing the given requirements, implement the required application:

with Object Oriented Programming style

following the rules of good programming style (e.g. adding comments, etc.)

using only the material covered in M251 (and its prerequisites)

 

Hints:

For each class, it is required to implement constructors, setters, getters, toString() method, and any other necessary method

If the user tries to do an operation that could violate the state of objects, the operation should be ignored and the application should display an error message (e.g. adding a passenger to the same trip twice, etc.)

Checking equality of any 2 objects should be done via the equals() method

There is a class that will do the main job of as follows:

o It has one collection to store the whole data (all trips)

o It has static methods, one for each operation happens frequently

o For each adding or removing operation, a message should be displayed to the user to explain the status of the operation (i.e. if it was successful or not)

 

Testing:

After implementing the required classes, design and implement a testing class to test them as follows:

Create at least 7 trips in at least 3 different dates and add them to the collection that stores the whole data then add and remove some passengers from them.

Try to violate the state of the objects and show that your code prevents all violations.

Show that the other operations that happen frequently are working fine

At the end, the whole data should be saved into a text file and this file should be saved automatically inside the folder contains your Java project

 

Marks distribution:

 

24 marks for the essential classes

30 marks for the class represents Trip

24 marks for the class that stores the whole data

11 marks for the testing class

5 marks for following the given instructions

6 marks for answering the two questions

 

Important notes on penalties:

 

Penalty on late submission: 10% per day

Penalty for not including the Java project: 50% of the achieved mark.

Penalty for not including the Word file: 50% of the achieved mark (after deducting any mark related to the Word file).

Penalty for not putting copy (not a snapshot) of the Java code into the Word file: 50% of the achieved mark.

Penalty on similarity percentage: according to AOU rules

 

(5/5)
Attachments:

Related Questions

. Introgramming & Unix Fall 2018, CRN 44882, Oakland University Homework Assignment 6 - Using Arrays and Functions in C

DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma

. The standard path finding involves finding the (shortest) path from an origin to a destination, typically on a map. This is an

Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t

. Develop a program to emulate a purchase transaction at a retail store. This program will have two classes, a LineItem class and a Transaction class. The LineItem class will represent an individual

Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th

. SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

. Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Um e HaniScience

512 Answers

Hire Me
expert
Muhammad Ali HaiderFinance

786 Answers

Hire Me
expert
Husnain SaeedComputer science

854 Answers

Hire Me
expert
Atharva PatilComputer science

726 Answers

Hire Me

Get Free Quote!

284 Experts Online