Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Thesis / Thesis.docx
Скачиваний:
3
Добавлен:
20.12.2024
Размер:
998.96 Кб
Скачать

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

  1. Calculate distance, bearing and more between Latitude/Longitude points. Movable Type Scripts. URL: https://www.movable-type.co.uk/scripts/lat­long.html

  2. Iterator library. URL: https://en.cpprefer­ence.com/w/cpp/iterator

  3. OMG® Unified Modeling Language p. 102-103. URL: https://www.omg.org/spec/UML/2.5.1/PDF

  4. Default comparisons. URL: https://en.cpprefer­ence.com/w/cpp/language/default_comparisons

  5. The rule of three/five/zero. URL: https://en.cpprefer­ence.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);

};

Соседние файлы в папке Thesis