, COS3711 Assignment 1 (COMPLETE GUIDELINE)
2025 - DUE April 2025; 100% TRUSTED Complete,
trusted solutions and explanations.
Question 1
Write a console application that can be run from the command line
#include <QCoreApplication>
#include <QCommandLineParser>
#include <QFile>
#include <QTextStream>
#include <QRegularExpression>
#include <QStringList>
#include <QDebug>
// Print usage instructions if no file names or incorrect parameters provided.
void printUsage() {
QTextStream out(stdout);
out << "Usage:\n";
out << " count // run without any parameters, prints this message\n";
out << " count file1.txt // pass one file name\n";
out << " count file1.txt file2.txt // pass more than one file name\n";
out << " count -a -b file1.txt file2.txt // pass flags to change behaviour\n";
out << " count -ab -c file1.txt // pass flags in an alternative way\n\n";
2025 - DUE April 2025; 100% TRUSTED Complete,
trusted solutions and explanations.
Question 1
Write a console application that can be run from the command line
#include <QCoreApplication>
#include <QCommandLineParser>
#include <QFile>
#include <QTextStream>
#include <QRegularExpression>
#include <QStringList>
#include <QDebug>
// Print usage instructions if no file names or incorrect parameters provided.
void printUsage() {
QTextStream out(stdout);
out << "Usage:\n";
out << " count // run without any parameters, prints this message\n";
out << " count file1.txt // pass one file name\n";
out << " count file1.txt file2.txt // pass more than one file name\n";
out << " count -a -b file1.txt file2.txt // pass flags to change behaviour\n";
out << " count -ab -c file1.txt // pass flags in an alternative way\n\n";