Assessment 5
QUIZ
Cos2614 assignment 05
2023
Question 1
Not yet answered
Marked out of 2.00
Consider the following code:
QString processString(QString aString) { QStringList result;
QStringList stringParts = aString.split(" ");
for (int i=stringParts.size()-1; i>=0; i--) {
result.append(stringParts.at(i));
}
return result.join(" ");
}
int main(int argc, char* argv[]) { QApplication app(argc, argv);
QString inputString = QInputDialog::getText(0, "Input", "Enter a string: ");
QMessageBox::information(0, "Results", processString(inputString));
return 0;
}
What happens if the user clicks the OK button in the QInputDialog without
entering any input?
a. An empty (no output string) QMessageBox will be displayed.
b. Run time error.
c. An error message will be displayed in a QMessageBox.
d. Nothing will happen.
QUIZ
Cos2614 assignment 05
2023
Question 1
Not yet answered
Marked out of 2.00
Consider the following code:
QString processString(QString aString) { QStringList result;
QStringList stringParts = aString.split(" ");
for (int i=stringParts.size()-1; i>=0; i--) {
result.append(stringParts.at(i));
}
return result.join(" ");
}
int main(int argc, char* argv[]) { QApplication app(argc, argv);
QString inputString = QInputDialog::getText(0, "Input", "Enter a string: ");
QMessageBox::information(0, "Results", processString(inputString));
return 0;
}
What happens if the user clicks the OK button in the QInputDialog without
entering any input?
a. An empty (no output string) QMessageBox will be displayed.
b. Run time error.
c. An error message will be displayed in a QMessageBox.
d. Nothing will happen.