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

COS3711 Assignment 1 (COMPLETE ANSWERS) semester 1 2025 - DUE April 2025; 100% trusted, comprehensive and complete reliable solution with clear explanation

Rating
-
Sold
-
Pages
25
Grade
A+
Uploaded on
16-04-2025
Written in
2024/2025

COS3711 Assignment 1 (COMPLETE ANSWERS) semester 1 2025 - DUE April 2025; 100% trusted, comprehensive and complete reliable solution with clear explanation

Institution
Course










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

Connected book

Written for

Institution
Course

Document information

Uploaded on
April 16, 2025
Number of pages
25
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

,COS3711 Assignment 1 (COMPLETE ANSWERS) semester
1 2025 - DUE April 2025; 100% trusted, comprehensive and
complete reliable solution with clear explanation


Table of Contents
1. Introduction
o Overview of the Calculator Application

o Design Patterns Implemented (Factory Method,

Singleton)
2. Class Hierarchy for Mathematical Operations
o Operation Class

 Abstract Method compute()

o Concrete Operation Classes

 AddOperation

 SubOperation

 MulOperation

 DivOperation

3. OperationFactory Class (Singleton)
o Singleton Design Pattern

o Method: create_operation()

4. Calculator GUI Implementation
o GUI Components

 QDoubleSpinBox for Input

 QPushButton for Operations (+, -, *, /, Clear)

 QLCDNumber for Display

o Event Handling

 Connecting Buttons to Slots

 Implementing Slot calculate()

5. Handling Edge Cases and Errors

, o Division by Zero
o Overflow Handling in QLCDNumber

6. Running the Application
o Setting Up the Environment

o Running the Calculator Script

7. Conclusion
o Summary of Features and Design

o Possible Improvements




Question 1 Write a console application that can be run from the
command line using the following forms: count // run without
any parameters count // pass one file name count fileT // pass
more than one file name count –a –b fileT // pass flags to change
behaviour count –ab –c // pass flags in an alternative way If no
arguments are provided, then print a message describing what
arguments should be included. The application should, using
regular expressions, count the number of occurrences of each of
the following in the text files given. • If the –a flag is set, count
the number of words longer than 4 characters that start with a
capital letter. There may be further capital letters in the word. •
If the –b flag is set, count the number of words that are
hyphenated. This hyphen should not be at the start or end of a
word. • If the –c flag is set, count the number of words that start
and end on the same character. • If the –d flag is set, count the
number of words that do not start with a vowel. Note that these
words can start with any character, and do not just have to start
with alphabetic characters. If no flags are provided, it is assumed
that all counts should be performed. It is suggested that you

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.
LearnedWriter University of south africa
Follow You need to be logged in order to follow users or courses
Sold
894
Member since
2 year
Number of followers
94
Documents
1174
Last sold
1 week ago
LearnedWriter

On this page you will find all documents offered by seller LearnedWriter.

4.1

107 reviews

5
57
4
21
3
20
2
5
1
4

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 tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card 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