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

COS2614 - Assignment 01 - Semester 1 & 2 - 2022

Rating
-
Sold
5
Pages
7
Grade
A+
Uploaded on
02-03-2022
Written in
2022/2023

COS2614 Semester 1 & 2 Assignment 1 2022 Solutions 100% Guaranteed.

Institution
Course








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

Written for

Institution
Course

Document information

Uploaded on
March 2, 2022
Number of pages
7
Written in
2022/2023
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

COS2614 - Assignment 01 – 2022
Due date
Friday, 29 April 2022, 11:00 PM

QUESTION 1
//sentenceprocessor.h

#ifndef SENTENCEPROCESSOR_H
#define SENTENCEPROCESSOR_H

#include <QString>
#include <QStringList>

class SentenceProcessor
{
public:
SentenceProcessor();
static int getWordNumber(QString sentence);
static int getVowelNumber(QString sentence);
static bool isReversible (QString sentence);
static QString wordsReversed(QString sentence);
static QString formatSentence(QString sentence);
};

#endif // SENTENCEPROCESSOR_H


//sentenceprocessor.cpp

#include "sentenceprocessor.h"

SentenceProcessor::SentenceProcessor()
{
}

int SentenceProcessor::getWordNumber(QString sentence)
{
return sentence.split(" ").count();
}

int SentenceProcessor::getVowelNumber(QString sentence)
{
sentence = sentence.toLower();

int vowelCount = 0;

for(int i = 0; i < sentence.size(); i++)
{
if(sentence[i] == 'a' || sentence[i] == 'e' || sentence[i] == 'i' ||
sentence[i] == 'o' || sentence[i] == 'u')


My Assignments 27682021794 www.myassignemnts.co.za

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.
MyAssignments My Assignments
Follow You need to be logged in order to follow users or courses
Sold
171
Member since
4 year
Number of followers
144
Documents
38
Last sold
4 months ago
My Assignments

3.8

21 reviews

5
11
4
3
3
2
2
1
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