
- •Coursework thesis
- •Task for coursework
- •Abstract
- •List of abbreviations
- •Introduction
- •Domain analysis
- •Designing the system
- •Interface classes iSerializible, iEmissionable and iCloneable
- •Class for transport information
- •Bus, Plane, Train classes
- •Data storing. Transport schedule class
- •Array of pointers. Container class.
- •User Interface Design
- •Software implementation
- •Clock and Time classes.
- •Coordinates structure implementation
- •StationInfo structure implementation
- •IEmissionable, iSerializable and iCloneable implementation
- •TransportInfo class implementation
- •Bus, Plane, Train class implementation
- •TransportSchedule class implementation
- •Conclusions
- •References
- •Appendix a File Time.H
- •File Time.Cpp
- •File Clocks.H
- •File Clocks.Cpp
- •File iSerializable.H
- •File iEmissionable.H
- •File iCloneable.H
- •File stdafx.H
- •File stdafx.Cpp
- •CoordinatesData.Json
- •File transports.Csv
- •File Coordinates.Cpp
- •File main.Cpp
- •File Route.Cpp
- •File Route.H
- •File StationInfo. Cpp
- •File StationInfo.H
- •File TransportSchedule.H
- •File TransportSchedule.Cpp
- •File PtrArray.Cpp
- •File TransportInfo.Cpp
- •File TransportInfo.H
- •File Bus.H
- •File Bus.Cpp
- •File Plane.H
- •File Plane.Cpp
- •File Train.H
- •File Train.Cpp
- •Appendix b
Conclusions
While performing this coursework, object-oriented system “Transport schedule” was developed. Stated tasks have been fully completed: developed a class for storing time, container to store transports, iterator for it, developed functionality for performing different operations on contents of stated structures, developed system for saving structures into files and loading saved information from the files, developed user interface which allow user to use all functions of created system.
Despite that this program already have a lot of functions, there are still lots of ways to improve. In the future it is possible to add real time data, separation into the locations of transports etc. Also, it is possible to develop better and more flexible save and load system which will allow user to create different saves and modify old ones without rewriting them. Also, graphical user interface can be developed for created program in the future.
During the development of program for this work, a lot of experience were gained. This experience includes using methods of object-oriented programming, using exception handling system, using template classes and containers from standard STL library, and using regular expressions. This experience is greatly beneficial and will be used in the future projects.
References
Calculate distance, bearing and more between Latitude/Longitude points. Movable Type Scripts. URL: https://www.movable-type.co.uk/scripts/latlong.html
Iterator library. URL: https://en.cppreference.com/w/cpp/iterator
OMG® Unified Modeling Language p. 102-103. URL: https://www.omg.org/spec/UML/2.5.1/PDF
Default comparisons. URL: https://en.cppreference.com/w/cpp/language/default_comparisons
The rule of three/five/zero. URL: https://en.cppreference.com/w/cpp/language/rule_of_three
Ministry of Education and Science of Ukraine
SOFTWARE SYSTEM “TRANSPORT SCHEDULE”
Program text
ГЮИК.508100.162 - 01 12 01
sheets 46
Appendix a File Time.H
#pragma once
#include "PtrArray.cpp"
class Time
{
protected:
time_t hours;
time_t minutes;
time_t seconds;
time_t total_secs() const;
public:
//Constructors
Time();
//Initialization constructors
Time(time_t h, time_t m, time_t s);
explicit Time(std::string_view str);
// Getter methods
time_t getHours() const;
time_t getMinutes() const;
time_t getSeconds() const;
// Setter methods
virtual bool setTime(time_t h, time_t m, time_t s);
virtual bool parseString(std::string_view str);
/* Operators */
//Arithmetic with value
Time operator+(time_t const value) const;
Time operator-(time_t const value)const;
Time operator+=(time_t const value);
Time operator-=(time_t const value);
//Arithmetic with object
Time operator+(Time const& other) const;
Time operator-(Time const& other) const;
Time operator+=(Time const& other);
Time operator-=(Time const& other);
Time& operator=(Time const& other);
std::strong_ordering operator<=>(Time const& other) const = default;
//Input/output operators
friend std::ostream& operator<<(std::ostream& out, Time const& other);
friend std::istream& operator>>(std::istream& in, Time& other);
friend std::ofstream& operator<<(std::ofstream& ofs, Time const& other);
friend std::ifstream& operator>>(std::ifstream& ifs, Time& other);
};