Page 1 of 1

Complete the program below to satisfy the requirements that follow: #include #include #inc

Posted: Sat Feb 19, 2022 3:21 pm
by answerhappygod
Complete the program below to satisfy the requirements that
follow:
#include <QApplication>
#include <QInputDialog>
#include <QMessageBox>
#include <QString>
int main(int argc, char *argv[]){
QApplication app(argc,argv);
// write lines of code to
include here
return 0;
}
Write down the additional lines of code in
the main() function so that it - reads a full name using
a QInputDialog in a comma separated format
(Example: Tshepo,Motsatsi).
- checks and processes the user input. If the
user input is empty or the number of words in the name is less than
2, then display an error message using a QMessageBox. If the
user input is correct, then display the full name (input) in a
space separated format (Example: Tshepo Motsatsi) in
a QMessageBox. Assume that a name may contain any number of
words.
You need not write the entire program. Write down only the
additional lines of code.