100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
COS2614 Exam pack 2024(Programming: Contemporary Concepts) $2.50   Add to cart

Exam (elaborations)

COS2614 Exam pack 2024(Programming: Contemporary Concepts)

 13 views  0 purchase
  • Course
  • Institution

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

Preview 4 out of 112  pages

  • October 7, 2024
  • 112
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
avatar-seller
COS2614 EXAM
PACK 2024

QUESTIONS AND
ANSWERS
FOR ASSISTANCE CONTACT
EMAIL:gabrielmusyoka940@gmail.com

, 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 (gabrielmusyoka940@gmail.com)

, 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 (gabrielmusyoka940@gmail.com)

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller gabrielmusyoka940. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $2.50. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

84866 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$2.50
  • (0)
  Add to cart