Escrito por estudiantes que aprobaron Inmediatamente disponible después del pago Leer en línea o como PDF ¿Documento equivocado? Cámbialo gratis 4,6 TrustPilot
logo-home
Otro

COS3711 Assignment 3 memo 2024 ready to submit

Puntuación
4.7
(3)
Vendido
23
Páginas
25
Subido en
04-09-2024
Escrito en
2024/2025

COS3711 Assignment 3 memo 2024 Assignment 3 1. Introduction Please use CMake (and not qmake) when setting up your assignment projects. Qt Designer should not be used to design user interfaces, and you are expected to manually set up GUIs to ensure that you properly handle memory using Qt’s parent-child functionality. Good programming practices should be followed. Follow standard naming conventions: class names start with a capital letter, variable and function names start with a lowercase letter, using camelCase for names made up of multiple words. Ensure consistent code layout and use of blank lines. Use forward class declarations in header files. Use initialiser lists in constructors. Have proper GUI management: setting cursor focus, sequential tabbing, clearing input widgets (like text input fields being cleared and spin boxes being returned to some default value), and enabling and disabling buttons as appropriate. Provide appropriate user feedback. Your code should build and run without any warnings.2. Questions Question 1 Refer to the UML diagram to answer this question. The Book class is burdened with two additional responsibilities: 1. obtainbookInfo() to get user input on book details (title, authors, ISBN, and date of publication) via a console, and 2. saveBook() to save the state of a Book instance into a file. Redesign the Book class so that the concept/process currently included in it is achieved using three different classes: 1. The Book class to represent a book with the necessary functions (as given in the above UML diagram). Remember that a book may have more than one author. 2. A BookWriter class which saves the state of a Book instance (values of the data members of that instance) in a file (you may save it in any sensible format). 3. A Graphical User Interface (GUI) class BookInput, which allows users to enter book information to create Book instances, which should also be saved to afile (using the BookWriter). Note: You can decide when Book instance(s) should be saved. Question 2 Make necessary changes to the Book class so that you can access the data members of Book instances using QMetaObject. Rewrite the BookWriter class so that the state of a Book instance can be accessed using the generated QMetaObject. Test the modified Book and BookWriter using BookInput. Question 3 Different systems use different rules for choosing passwords. Here are some examples of such rules: Rule 1: It must consist of a minimum of five characters and no spaces are allowed. Rule 2: It must consist of 5 characters, where the third character can be either a digit or an alphabetic character (a-f or A-F). Rule 3: It must consist of a minimum of four and a maximum of six digits and the starting digit cannot be 0. Write a program that asks the user to select one validation technique stated above using QCheckBox and then to enter a password in a QLineEdit. The program should evaluate whether the provided password satisfies the selected validation rule. Question 4 Write a class named PrimeFinder, capable of running as a thread, to find prime numbers between two given numbers. Write a GUI application that allows a user to enter start and end numbers as well as the number of threads to use (maximum 4). When Start is clicked, the task should be divided into the required number of parts, the required number of PrimeFinder threads started, and the primes displayed in an appropriate window (per thread) as they are found. This is to be done without using QtConcurrent – you are to manage the threads yourself, and clean up after the threads have completed their work. This means that youshould be able to change the start, end, and number of thread numbers and click Start again without the program crashing or producing strange results. Also, you should handle a user closing the application (closeEvent) before the threads have completed running so that the threads can tidy up after themselves before the application is closed. The above screenshot is only an example, and you can design the graphical user interface as you wish as long as it satisfies the above requirements.

Mostrar más Leer menos
Institución
Grado

Vista previa del contenido

COS3711 2024 ASSIGNMENT 3
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;
}

Escuela, estudio y materia

Institución
Grado

Información del documento

Subido en
4 de septiembre de 2024
Número de páginas
25
Escrito en
2024/2025
Tipo
OTRO
Personaje
Desconocido

Temas

$10.39
Accede al documento completo:
Comprado por 23 estudiantes

¿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

Reseñas de compradores verificados

Se muestran los 3 comentarios
1 año hace

projects are always perfect. 100% guaranteed

1 año hace

Thank you luwayla

1 año hace

1 año hace

4.7

3 reseñas

5
2
4
1
3
0
2
0
1
0
Reseñas confiables sobre Stuvia

Todas las reseñas las realizan usuarios reales de Stuvia después de compras verificadas.

Conoce al vendedor

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.
CrystalIndigo University of South Africa (Unisa)
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
486
Miembro desde
5 año
Número de seguidores
226
Documentos
73
Última venta
5 meses hace
CrystalIndigo Solutions

providing all solutions to all computer science modules

4.1

51 reseñas

5
27
4
13
3
6
2
1
1
4

Documentos populares

Recientemente visto por ti

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