• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 2 fuera de 10 páginas
Examen

COS3711 Assignment 1 (COMPLETE ANSWERS) 2026 - Due 15 May 2026

Document preview thumbnail
Vista previa 2 fuera de 10 páginas

Advanced Programming - COS3711 Assignment 1 2026 - Due 15 May 2026; 100 % TRUSTED workings, Expert Solved, Explanations and Solutions. For assistance call or W.h.a.t.s.a.p.p us on ...(.+.2.5.4.7.7.9.5.4.0.1.3.2)........... COS3711/Assignment 1/2026 For this question you need to ensure that you design the appropriate classes needed to address the specification below. Create a console application to handle vehicle details. Considering the required functionality that is required and OOP design principles (avoiding anti-patterns and having minimal redundant code), create and implement the appropriate classes necessary to achieve the following. • A vehicle needs to have a model and a year (which should be a reasonable value). There are basically 2 types of vehicles: passenger vehicles (that can carry a specified number of passengers) and transport vehicles (that have a set carrying capacity expressed in kilograms). Vehicles that are created without the necessary details should have default values. • Ensure all appropriate getters and setters are included. • Include a function that can output the details of the vehicle. • Use Qt’s parent-child facility to implement a list of vehicles. • Test your solution by creating some passenger and transport vehicles (at least one of which is created using the default constructor), adding them to the list, and then outputting the values in the list to the console. Question 2 This question tests the concepts of reflection and meta-objects. Extend the application you wrote in question 1 by adding a class named FileWriter as described in the UML class diagram below:

Vista previa del contenido

COS3711
ASSIGNMENT 1 2026

UNIQUE NO.
DUE DATE: 15 MAY 2026

, Advanced Programming - COS3711

Question 1: Vehicle Console Application (OOP + Qt Parent-Child)

Vehicle Base Class (vehicle.h)

#ifndef VEHICLE_H
#define VEHICLE_H

#include <QObject>
#include <QString>

class Vehicle : public QObject
{
Q_OBJECT
Q_PROPERTY(QString model READ getModel WRITE setModel)
Q_PROPERTY(int year READ getYear WRITE setYear)

public:
explicit Vehicle(QObject *parent = nullptr);
Vehicle(QString model, int year, QObject *parent = nullptr);

QString getModel() const;
int getYear() const;

void setModel(const QString &model);
void setYear(int year);

virtual QString toString() const;

protected:
QString model;
int year;
};

#endif

Vehicle Implementation (vehicle.cpp)

#include "vehicle.h"

Vehicle::Vehicle(QObject *parent) : QObject(parent), model("Unknown"),
year(2000) {}

Vehicle::Vehicle(QString model, int year, QObject *parent)
: QObject(parent), model(model), year(year > 1885 ? year : 2000) {}

QString Vehicle::getModel() const { return model; }
int Vehicle::getYear() const { return year; }

void Vehicle::setModel(const QString &model) { this->model = model; }

Libro relacionado
 image
Gianna Cioni, Andrzej Salwicki Advanced Programming Methodologies
Editorial: 2014 ISBN: 9781483265452 Edición: Desconocido

Información del documento

Subido en
27 de abril de 2026
Número de páginas
10
Escrito en
2025/2026
Tipo
Examen
Contiene
Preguntas y respuestas
$3.01

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
LIBRARYpro
3.7
(1506)
Vendido
10793
Seguidores
4904
Artículos
5062
Última venta
2 horas hace



Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes