CTA Station Management System Design

Verified

Added on  2019/09/20

|6
|842
|99
Practical Assignment
AI Summary
This document outlines the design and testing plan for a CTA station management system. It details the user interface, programmer tasks including data input, processing, storage, and polymorphism implementation. The document also lists the classes required, provides a UML class diagram, and presents a comprehensive test plan covering menu options and error handling. The system is designed to manage station details, search, add, delete, and view routes between stations, and find the nearest station to a location. The test plan includes expected behavior and error-resistant input testing.
Document Page
Class Diagram
Testing Plan
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
1.Describe the user interface. What are the menu options and how will the user use the
application?
Ans: There is one interface: CTAStations. This interface defines some methods that will be
implemented by the Station class. My menu contains the total 6 options. The description of the
menu options are defined as:
1 Add new station details
2 Search a station
3 Delete a station
4 View root between start and end station
5 Find the nearest station to a location
6 Exit
2. Describe the programmers’ tasks.
a) Describe how you will read the input file.
Ans: There is a CTAProcessClass class which process the all the functionalities of the tasks.
There is one class CTA class has the main method. The user interact with the CTA class and all
data handling is done in the CTAProcessClass class. When program starts the CTA class call the
method readFile of the CTAProcessClass calss.
b) Describe how you will process the data from the input file.
Ans: The all relevant data is read from the input file and then it stores in lists. There are some list
which are defined previously. I have created the list for each line.
c. Describe how you will store the data (what objects will you store?)
Ans: I have created the separate classes for each line and there is one class to store the Station
class. I have created a list for each line to store the each station details on this line.
d. How will you demonstrate polymorphism?
Ans: There is a CTA class. In this class I have used some method which are override. There are
a class in which the constructors are overloaded to supply the different data in the class at
different type.
Document Page
Override function name with class name:
1.CTAStations interface:
public int getSequenceNo();
public void setSequenceNum(int sequenceNum);
2.Station class methods
@Override
public int getSequenceNo() {
return this.sequenceNum;
}
@Override
public void setSequenceNum(int sequenceNum) {
this.sequenceNum = sequenceNum;
}
3. All line classes extend the Station class. So these two methods are also override bye Line
classes.
e. How will you add/delete/modify data?
Ans: I have used the list to store the number of stations details in the list.
Process to add new station details: first I have read all the details about the station and the ask
for line (red, green, ..etc) and the I have added this new station at the end of red line and set the
sequence number for this station and finally this is added to the end of arraylist of that line.
f. How will you search data?
Ans: I have asked for the station name and the print the details of that station.
3. List the classes you will need to implement your application.
Ans:
Inerface CTAStations
List of classes:
1. Station
2. RedLine
3. GreenLine
4. BrownLine
5. BlueLiine
Document Page
6. BrownLine
7. PinkLine
8. PurpleLine
9. OrangeLine
10. YellowLine
11. CTAProcessClass
12. CTA
4. Draw a UML class diagram that shows all classes in the program and their relationships.
Ans:
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
5. Think how you will determine if your code functions are expected. Develop a test plan
based on the above description; how will you test that the expected outputs have been
achieved? Be sure this test plan is complete. Your test plan should minimally:
a. Test each option in the menu-driven user interface for
i. Expected behavior
Ans:
Test Cases:
Test Cases Input Expected output Actual result
Add new station
details
All station details
and the line name is
asked from the user
And add to that
particular list
Return “The station
details are
successfully added”
This is working fine.
Search a station Morgan This station is on
Pinkline:
Station Name:
Morgan
Location:
elevated
Wheelchair: true
Sequence Number:
12
This station is on
Greenline:
Station Name:
Morgan
Location:
elevated
Wheelchair: true
Sequence Number:
12
The output is exact
as expected
Delete a station Station name:
Clark/Lake
Line name:
I have numbered all
the line start by 1
and end by 8 so user
have to enter 1ine
number in between
them to delete that
station
Line number: 2
"Search station
name is not found
on this line!!”
Output as expected
Document Page
ii. Error-resistant input:
Ans:
The entire code is write in the try catch body. If user enter wrong input so user will get a
message and the main menu will printed again to user.
System.out.println("Input exception !");
chevron_up_icon
1 out of 6
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]