100% tevredenheidsgarantie Direct beschikbaar na je betaling Lees online óf als PDF Geen vaste maandelijkse kosten
logo-home
COS3711 Assignment 2 (COMPLETE ANSWERS) 2024 - DUE 18 July 2024 $2.60
In winkelwagen

Tentamen (uitwerkingen)

COS3711 Assignment 2 (COMPLETE ANSWERS) 2024 - DUE 18 July 2024

 0 keer verkocht
  • Vak
  • Instelling
  • Boek

Exam study book Advanced Programming Methodologies of Gianna Cioni, Andrzej Salwicki - ISBN: 9781483265452 (Guaranteed Success)

Voorbeeld 4 van de 34  pagina's

  • 16 juli 2024
  • 34
  • 2023/2024
  • Tentamen (uitwerkingen)
  • Vragen en antwoorden
avatar-seller
COS3711 Assignment 2 (COMPLETE ANSWERS) 2024 - DUE 18 July 2024

Question 1

Study the following UML class diagram: The UML class diagram is an initial

design of classes for a conference registration application. There are three

types of registration allowed for the conference: standard registration, student

registration and invited guests registration. The standard registration fee is the

standard fee (stored in STANDARD_FEE). For those registered as students,

the conference fee is half the price of the standard registration fee. For those

registered as guests, the conference fee is 10% of the standard registration

fee. An instance of RegistrationList contains a list of Registration*. No two

registrations are allowed to have attendees with the same e-mail addresses,

unless the names are different. You should be able to query a RegistrationList

whether a person (by the name) is already registered for the conference. A

RegistrationList can also return the number of attendees that are registered

for the conference from an institution. Similarly, you can request the total

registration fees for a type (“Registration”, “StudentRegistration”,

“GuestRegistration” or “All”) of registration. You are expected to use Qt’s

metaobject system to access the type of a Registration in RegistrationList.

Downloaded by Corona Virus () lOMoARcPSD| Write a GUI application that

allows users to register for a conference. The GUI should display the current

list of registrations, including the respective registration fees, in the


For assistance whatsapp +254702715801

,RegistrationList at all times, using a table widget. The interface should also

allow users to request and view the results of the various operations

supported by the RegistrationList class. You are allowed to add new features

to the classes given in the UML diagram, although you are not allowed to

delete or change the given functions. You can decide on the design of the

GUI, and it can be done manually or using Qt Designer. You are expected to

follow good programming principles.

### Step 1: Define the Classes and Inheritance



Based on the UML diagram description, you will have the following classes:



1. **Registration** (base class)

2. **StandardRegistration** (inherits from Registration)

3. **StudentRegistration** (inherits from Registration)

4. **GuestRegistration** (inherits from Registration)

5. **RegistrationList** (manages a list of registrations)



Each class will have attributes and methods corresponding to the

requirements.



### Step 2: Implement the Classes


For assistance whatsapp +254702715801

,#### Registration Class

```cpp

class Registration {

public:

Registration(const QString &name, const QString &email);

virtual ~Registration() = default;

QString getName() const;

QString getEmail() const;

virtual double getFee() const = 0; // Pure virtual function

protected:

QString name;

QString email;

};



Registration::Registration(const QString &name, const QString &email) :

name(name), email(email) {}



QString Registration::getName() const { return name; }

QString Registration::getEmail() const { return email; }

```


For assistance whatsapp +254702715801

, #### StandardRegistration Class

```cpp

class StandardRegistration : public Registration {

public:

StandardRegistration(const QString &name, const QString &email);

double getFee() const override;

private:

static constexpr double STANDARD_FEE = 100.0; // Example fee

};



StandardRegistration::StandardRegistration(const QString &name, const

QString &email) : Registration(name, email) {}



double StandardRegistration::getFee() const {

return STANDARD_FEE;

}

```



#### StudentRegistration Class

```cpp


For assistance whatsapp +254702715801

Dit zijn jouw voordelen als je samenvattingen koopt bij Stuvia:

Bewezen kwaliteit door reviews

Bewezen kwaliteit door reviews

Studenten hebben al meer dan 850.000 samenvattingen beoordeeld. Zo weet jij zeker dat je de beste keuze maakt!

In een paar klikken geregeld

In een paar klikken geregeld

Geen gedoe — betaal gewoon eenmalig met iDeal, Bancontact of creditcard en je bent klaar. Geen abonnement nodig.

Focus op de essentie

Focus op de essentie

Studenten maken samenvattingen voor studenten. Dat betekent: actuele inhoud waar jij écht wat aan hebt. Geen overbodige details!

Veelgestelde vragen

Wat krijg ik als ik dit document koop?

Je krijgt een PDF, die direct beschikbaar is na je aankoop. Het gekochte document is altijd, overal en oneindig toegankelijk via je profiel.

Tevredenheidsgarantie: hoe werkt dat?

Onze tevredenheidsgarantie zorgt ervoor dat je altijd een studiedocument vindt dat goed bij je past. Je vult een formulier in en onze klantenservice regelt de rest.

Van wie koop ik deze samenvatting?

Stuvia is een marktplaats, je koop dit document dus niet van ons, maar van verkoper edwardsokengo. Stuvia faciliteert de betaling aan de verkoper.

Zit ik meteen vast aan een abonnement?

Nee, je koopt alleen deze samenvatting voor $2.60. Je zit daarna nergens aan vast.

Is Stuvia te vertrouwen?

4,6 sterren op Google & Trustpilot (+1000 reviews)

Afgelopen 30 dagen zijn er 68175 samenvattingen verkocht

Opgericht in 2010, al 15 jaar dé plek om samenvattingen te kopen

Start met verkopen

Laatst bekeken door jou


$2.60
  • (0)
In winkelwagen
Toegevoegd