100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

COS2614 Exam pack 2024(Programming: Contemporary Concepts)

Rating
-
Sold
3
Pages
112
Grade
A+
Uploaded on
07-10-2024
Written in
2024/2025

COS2614 Exam pack 2024(Programming: Contemporary Concepts) With accurate answers and assurance that they are in the exam.

Institution
Course











Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Course

Document information

Uploaded on
October 7, 2024
Number of pages
112
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

COS2614 EXAM
PACK 2024

QUESTIONS AND
ANSWERS
FOR ASSISTANCE CONTACT
EMAIL:

, lOMoARcPSD|31863004




COS2614 October/November 2014

1 Question 1

1.1 Complete Main for Input Age



MainFunction



QString userInput = QInputDialog::getText(0,”DOB”,”Enter Date of Birth (Format dd/mm/yyyy)”);

QStringList strDOB = QString.split(“/”);

QList<int> IntDOB;

For (int I = 0; I < strDOB.size(); i++)

{

IntDOB.append(strDOB[i].toInt());

}

Int userAge = computerAge(IntDOB[0]/intDOB[1]/intDOB[2]));



QMessageBox::Information(0,”Your Age”, userAge);



1.2 DateList manages a list of QDate. Explain three different ways of designing such a class.

1) class DateList : public QList;

2) You can create a QList<QDates> as a member function.

3) You can have a DateList class which has *QDate objects



#include QDate

#include QList

#include




Page 1 of 8

, lOMoARcPSD|31863004




COS2614 October/November 2014


1.3 Draw a UML representation of the relationship between QDate and DateList where QDate
instances exist after a DateList Instance has been destroyed.



QList




DateList Date


#Date d; #date QDate




1.4 Name the widget class in QT framework that is only used to input a date

QCalendarWidget




Page 2 of 8


Downloaded by Gabriel Musyoka ()

, lOMoARcPSD|31863004




COS2614 October/November 2014



2 UML Diagram




2.1 Virtual double pay() = 0;


2.2 You cannot instantiate a pure virtual function


2.3 Hourly::Hourly(double hr) : Payment(“Hourly”){
HourlyRate = hr;
Hours = 0.0;
}




Page 3 of 8


Downloaded by Gabriel Musyoka ()

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
gabrielmusyoka940 db
Follow You need to be logged in order to follow users or courses
Sold
1457
Member since
2 year
Number of followers
247
Documents
1488
Last sold
1 week ago
Bstudy

provides latest exam paper

3.2

214 reviews

5
68
4
28
3
49
2
20
1
49

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can immediately select a different document that better matches what you need.

Pay how you prefer, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card or EFT and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions