Assignment 1 2025
Unique #:
Due Date: April 2025
Detailed solutions, explanations, workings
and references.
+27 81 278 3372
, QUESTION 1
Console Application
#include <QCoreApplication>
#include <QFile>
#include <QTextStream>
#include <QRegularExpression>
#include <QDate>
#include <QStringList>
#include <iostream>
void printUsage() {
std::cout << "Usage:\n";
std::cout << "count [flags] [file1.txt file2.txt ...]\n";
std::cout << "Flags:\n";
std::cout << " -a Count capitalized words longer than 4
characters\n";
std::cout << " -b Count hyphenated words\n";
std::cout << " -c Count words that start and end with the
same letter\n";
std::cout << " -d Count words that do NOT start with a
vowel\n";
}
QString preprocessText(const QString &content) {
Varsity Cube 2025 +27 81 278 3372