UNISA
Advanced Programming
COS3711
Year module
Computer Science Department
This document contain 1.link to access .zip file and 2. coding
and 3. important steps on how to run it
If having hard time accessing the link reach me scroll to the
bottom of the document, you will find the link and access the
.zip file.….. thank you
COS3711_Assignment1 (1).zip
, Project Structure
COS3711_Assignment1/
│
├── COS3711_Assignment1.pro
├── main.cpp
│
├── Vehicle.h
├── PassengerVehicle.h
├── TransportVehicle.h
├── FileWriter.h
1. COS3711_Assignment1.pro
QT += core gui
CONFIG += c++11 console
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += main.cpp
HEADERS += \
Vehicle.h \
PassengerVehicle.h \
TransportVehicle.h \
FileWriter.h
2. main.cpp
#include <QCoreApplication>
#include <QList>
#include <QDebug>
#include "Vehicle.h"
#include "PassengerVehicle.h"
#include "TransportVehicle.h"
#include "FileWriter.h"
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QObject parent;
QList<QObject*> vehicleList;
// Create vehicles
PassengerVehicle *p1 = new PassengerVehicle("Toyota", 2020, 5,
&parent);
PassengerVehicle *p2 = new PassengerVehicle(&parent); // default