MEMO
THERE IS A LINK TO THE ZIPPED FILE AT THE END OF THIS DOCUMENT
Crystal Indigo!
Crystal Indigo!
Providing all solutions you need anytime
+27 76 626 8187
**NOTE: if the GUI is displaying differently from what you desire just change
how the widgets are displayed. copy the code and run DO necessary
changes. If you having trouble running, reach out
,Redesigned UML
Code Outputs
Q1 and 2 the GUI output is the same, just different code
,Q3
,
,Q4
Source Code
Question 1
//book.h
#ifndef BOOK_H
#define BOOK_H
#include <QString>
#include <QStringList>
#include <QDate>
class Book {
public:
Book();
Book(const QString& t, const QStringList& a, const QString& i, const
QDate& p);
, void setTitle(const QString& t);
void setAuthors(const QStringList& a);
void setIsbn(const QString& i);
void setPublicationDate(const QDate& p);
QString getTitle() const;
QStringList getAuthors() const;
QString getIsbn() const;
QDate getPublicationDate() const;
private:
QString title;
QStringList authors;
QString isbn;
QDate publicationDate;
};
#endif // BOOK_H
//book.cpp
#include "book.h"
Book::Book() {}
Book::Book(const QString &t, const QStringList &a, const QString &i, const
QDate &p)
: title(t), authors(a), isbn(i), publicationDate(p) {}
void Book::setTitle(const QString &t)
{
title = t;
}
void Book::setAuthors(const QStringList &a)
{
authors = a;
}
void Book::setIsbn(const QString &i)
{
isbn = i;
}
void Book::setPublicationDate(const QDate &p)
{
publicationDate = p;
}
QString Book::getTitle() const
{
return title;
}