Структура программы.
Разработка программы для обучения нахождению определителя матрицы
Ui→plainTextEdit→setPlainText («0*(8*(3*(-2)-3*(-1))-0*(3*(-2)-3*0)+(-1)*(3*(-1)-3*0))-0*(1*(3*(-2)-3*0)-0*(-4*(-2)-3*16)+(-1)(-4*(-1)-3*16))+14*(1*(3*(-2)-3*0)-8*((-4)*(-2)-3*16)+(-1)*(-4*(-1)-3*16))-6*(1*(3*(-1)-3*0)-8*(-4*(-1)-3*16)+0*(-4*0−3*16))»); Ввод данных, правильное выполнение, показывает, что задание выполнено повторно, шкала прогресса, выполненные задания отмечены плюсом… Читать ещё >
Структура программы. Разработка программы для обучения нахождению определителя матрицы (реферат, курсовая, диплом, контрольная)
Рис. 6 Структура программы
Распечатка программы
#include «mainwindow.h» .
#include «ui_mainwindow.h» .
#include «stdio.h» .
#include «QString» .
#include «qstring.h» .
#include «stdlib.h» .
#include «QProgressBar» .
MainWindow:MainWindow (QWidget *parent) :
QMainWindow (parent),.
ui (new Ui: MainWindow).
{.
ui->setupUi (this);
ui->progressBar->setValue (0);
ui->textBrowser2->setText («0»);
ui->textEdit_pin->hide ();
ui->pushButton_ans->hide ();
ui->pushButton_pin->hide ();
ui->pushButton_user->hide ();
ui->label11->hide ();
ui->textBrowser3->hide ();
}.
MainWindow:~MainWindow ().
{.
delete ui;
}.
void MainWindow: on_pushButton2_clicked ().
{.
int num = ui->plainTextEdit2->toPlainText ().toInt ();
if (num==1).
{.
if (ui->pz1->toPlainText ()=="+").
ui->textBrowser->setText («3 15 2 1 You’ve' already done this.»);
else.
ui->textBrowser->setText («3 15 2 1»);
}.
if (num==2).
{.
if (ui->pz2->toPlainText ()=="+").
ui->textBrowser->setText («0 4 -2 132 You’ve' already done this.»);
else.
ui->textBrowser->setText («0 4 -2 132»);
}.
if (num==3).
{.
if (ui->pz3->toPlainText ()=="+").
ui->textBrowser->setText («144 132 -11 -8 You’ve' already done this.»);
else.
ui->textBrowser->setText («144 132 -11 -8»);
}.
if (num==4).
{.
if (ui->pz4->toPlainText ()=="+").
ui->textBrowser->setText («5 1 6 3 4 8 0 1 5 You’ve' already done this.»);
else.
ui->textBrowser->setText («5 1 6 3 4 8 0 1 5»);
}.
if (num==5).
{.
if (ui->pz5->toPlainText ()=="+").
ui->textBrowser->setText («2 -3 11 0 0 -2 5 -1 9 You’ve' already done this.»);
else.
ui->textBrowser->setText («2 -3 11 0 0 -2 5 -1 9»);
}.
if (num==6).
{.
if (ui->pz6->toPlainText ()=="+").
ui->textBrowser->setText («11 -6 -12 0 -1 5 4 8 16 You’ve' already done this.»);
else.
ui->textBrowser->setText («11 -6 -12 0 -1 5 4 8 16»);
}.
if (num==7).
{.
if (ui->pz7->toPlainText ()=="+").
ui->textBrowser->setText («1 0 -1 3 7 4 8 -2 0 -6 3 4 1 8 1 0 You’ve' already done this.»);
else.
ui->textBrowser->setText («1 0 -1 3 7 4 8 -2 0 -6 3 4 1 8 1 0»);
}.
if (num==8).
{.
if (ui->pz8->toPlainText ()=="+").
ui->textBrowser->setText («0 0 14 -6 1 8 0 -1 -4 3 3 3 16 0 -1 -2 You’ve' already done this.»);
else.
ui->textBrowser->setText («0 0 14 -6 1 8 0 -1 -4 3 3 3 16 0 -1 -2)»);
}.
if (num==9).
{.
if (ui->pz9->toPlainText ()=="+").
ui->textBrowser->setText («-5 7 -16 28 7 4 8 -2 0 -6 3 4 1 8 1 0 You’ve' already done this.»);
else.
ui->textBrowser->setText («-5 7 -16 28 7 4 8 -2 0 -6 3 4 1 8 1 0»);
}.
if (num==10).
{.
if (ui->pz10->toPlainText ()=="+").
ui->textBrowser->setText («1 5−3 0−5 0−6 3 5 0 0 5 0 6 0 0 5 0 0 0 0 4 0 5 1 1 0 9 0 1 5 0 5 9 0 0 9 6 0 0 0 5 0 0 2 0 2 0 0 1 6 6 1 0 0 0 0 6 0 0 0 0 0 6 5 0 5 0 5 1 0 0 0 0 0 0 0 9 0 0 6 0 5 1 0 5 0 7 0 4 0 5 0 1 0 0 5 0 2 0 You’ve' already done this.»);
else.
ui->textBrowser->setText («1 5−3 0−5 0−6 3 5 0 0 5 0 6 0 0 5 0 0 0 0 4 0 5 1 1 0 9 0 1 5 0 5 9 0 0 9 6 0 0 0 5 0 0 2 0 2 0 0 1 6 6 1 0 0 0 0 6 0 0 0 0 0 6 5 0 5 0 5 1 0 0 0 0 0 0 0 9 0 0 6 0 5 1 0 5 0 7 0 4 0 5 0 1 0 0 5 0 2 0»);
}.
if (num>10).
ui->textBrowser->setText («No such nomber»);
if (!(ui->plainTextEdit2->toPlainText ().toInt ())||num<1).
ui->textBrowser->setText («Something wrong»);
}.
void MainWindow: on_pushButton_clicked ().
{.
QString z1p, z3p, z2p, z4p, z5p, z6p, z7p, z8p, z9p, z10p;
int i=0,s;
bool f=true;
int prog=ui->textBrowser2->toPlainText ().toInt ();
int num = ui->plainTextEdit2->toPlainText ().toInt ();
ui->textBrowser3->hide ();
ui->label2->setText (««);
ui->label3->setText (««);
ui->label4->setText (««);
ui->label5->setText (««);
ui->label6->setText (««);
if (num==1).
{.
z1p=ui->plainTextEdit->toPlainText ();
QString z1="3*1−15*2″ ;
s=3*1−15*2;
for (i=0;i<=z1p.size ()&&f==true;i++).
if (z1p[i]≠z1[i]).
{.
ui->label2->setText («Mistake after»);
ui->label4->setText (QString:number (i));
ui->label5->setText («element!»);
f=false;
}.
if (s≠ui->textEdit2->toPlainText ().toInt ()).
{.
ui->label6->setText («Wrong answer. Check again»);
f=false;
}.
if (z1p.size ().
{.
ui->label6->setText («You missed something or didn’t finish term»);
f=false;
}.
if (z1p.size ()>z1.size ()).
{.
ui->label6->setText («You wrote more then need. Check your derivation»);
f=false;
}.
if (z1p.size ()==0).
{.
ui->label6->setText («You didn’t write anything.»);
f=false;
}.
if (f==true).
{.
ui->label2->setText («Good job!»);
if (ui->pz1->toPlainText ()≠"+").
{.
prog++;
ui->textBrowser2->setText (QString:number (prog));
ui->progressBar->setValue (prog*10);
ui->pz1->setText («+»);
}.
}.
}.
if (num==2).
{.
z2p=ui->plainTextEdit->toPlainText ();
QString z2="0*132−4*(-2)" ;
s=0*132−4*(-2);
for (i=0;i<=z2p.size ()&&f==true;i++).
if (z2p[i]≠z2[i]).
{.
ui->label2->setText («Mistake after»);
ui->label4->setText (QString:number (i));
ui->label5->setText («element!»);
f=false;
}.
if (z2p.size ().
{.
ui->label6->setText («You missed something or didn’t finish term»);
f=false;
}.
if (z2p.size ()>z2.size ()).
{.
ui->label6->setText («You wrote more then need. Check your derivation»);
f=false;
}.
if (s≠ui->textEdit2->toPlainText ().toInt ()).
{.
ui->label6->setText («Wrong answer. Check again»);
f=false;
}.
if (f==true).
{.
ui->label2->setText («Good job!»);
if (ui->pz2->toPlainText ()≠"+").
{.
prog++;
ui->textBrowser2->setText (QString:number (prog));
ui->progressBar->setValue (prog*10);
ui->pz2->setText («+»);
}.
}.
}.
if (num==3).
{.
z3p=ui->plainTextEdit->toPlainText ();
QString z3="144*(-8)-132*(-11)" ;
s=144*(-8)-132*(-11);
for (i=0;i<=z3p.size ()&&f==true;i++).
if (z3p[i]≠z3[i]).
{.
ui->label2->setText («Mistake after»);
ui->label4->setText (QString:number (i));
ui->label5->setText («element!»);
f=false;
}.
if (z3p.size ().
{.
ui->label6->setText («You missed something or didn’t finish term»);
f=false;
}.
if (z3p.size ()>z3.size ()).
{.
ui->label6->setText («You wrote more then need. Check your derivation»);
f=false;
}.
if (s≠ui->textEdit2->toPlainText ().toInt ()).
{.
ui->label6->setText («Wrong answer. Check again»);
f=false;
}.
if (f==true).
{.
ui->label3->setText (QString:number (s));
ui->label2->setText («Good job!»);
if (ui->pz3->toPlainText ()≠"+").
{.
prog++;
ui->textBrowser2->setText (QString:number (prog));
ui->progressBar->setValue (prog*10);
ui->pz3->setText («+»);
}.
}.
}.
if (num==4).
{.
z4p=ui->plainTextEdit->toPlainText ();
QString z4="5*(4*5−1*8)-1*(3*5−8*0)+6*(3*1−4*0)" ;
s=5*(4*5−1*8)-1*(3*5−8*0)+6*(3*1−4*0);
for (i=0;i<=z4p.size ()&&f==true;i++).
if (z4p[i]≠z4[i]).
{.
ui->label2->setText («Mistake after»);
ui->label4->setText (QString:number (i));
ui->label5->setText («element!»);
f=false;
}.
if (z4p.size ().
{.
ui->label6->setText («You missed something or didn’t finish term»);
f=false;
}.
if (z4p.size ()>z4.size ()).
{.
ui->label6->setText («You wrote more then need. Check your derivation»);
f=false;
}.
if (s≠ui->textEdit2->toPlainText ().toInt ()).
{.
ui->label6->setText («Wrong answer. Check again»);
f=false;
}.
if (f==true).
{.
ui->label2->setText («Good job!»);
if (ui->pz4->toPlainText ()≠"+").
{.
prog++;
ui->textBrowser2->setText (QString:number (prog));
ui->progressBar->setValue (prog*10);
ui->pz4->setText («+»);
}.
}.
}.
if (num==5).
{.
z5p=ui->plainTextEdit->toPlainText ();
QString z5="2*(0*9-(-1)*(-2))-(-3)*(0*9-(-2)*(-1))+11*(0*(-1)-0*5)" ;
s=2*(0*9-(-1)*(-2))-(-3)*(0*9-(-2)*(-1))+11*(0*(-1)-0*5);
for (i=0;i<=z5p.size ()&&f==true;i++).
if (z5p[i]≠z5[i]).
{.
ui->label2->setText («Mistake after»);
ui->label4->setText (QString:number (i));
ui->label5->setText («element!»);
f=false;
}.
if (z5p.size ().
{.
ui->label6->setText («You missed something or didn’t finish term»);
f=false;
}.
if (z5p.size ()>z5.size ()).
{.
ui->label6->setText («You wrote more then need. Check your derivation»);
f=false;
}.
if (s≠ui->textEdit2->toPlainText ().toInt ()).
{.
ui->label6->setText («Wrong answer. Check again»);
f=false;
}.
if (f==true).
{.
ui->label3->setText (QString:number (s));
ui->label2->setText («Good job!»);
if (ui->pz5->toPlainText ()≠"+").
{.
prog++;
ui->textBrowser2->setText (QString:number (prog));
ui->progressBar->setValue (prog*10);
ui->pz5->setText («+»);
}.
}.
}.
if (num==6).
{.
z6p=ui->plainTextEdit->toPlainText ();
QString z6="11*((-1)*16−5*8)-(-6)*(0*16−5*4)+(-12)*(0*8-(-1)*4)" ;
s=11*((-1)*16−5*8)-(-6)*(0*16−5*4)+(-12)*(0*8-(-1)*4);
for (i=0;i<=z6p.size ()&&f==true;i++).
if (z6p[i]≠z6[i]).
{.
ui->label2->setText («Mistake after»);
ui->label4->setText (QString:number (i));
ui->label5->setText («element!»);
f=false;
}.
if (z6p.size ().
{.
ui->label6->setText («You missed something or didn’t finish term»);
f=false;
}.
if (z6p.size ()>z6.size ()).
{.
ui->label6->setText («You wrote more then need. Check your derivation»);
f=false;
}.
if (s≠ui->textEdit2->toPlainText ().toInt ()).
{.
ui->label6->setText («Wrong answer. Check again»);
f=false;
}.
if (s≠ui->textEdit2->toPlainText ().toInt ()).
{.
ui->label6->setText («Wrong answer. Check again»);
f=false;
}.
if (f==true).
{.
ui->label2->setText («Good job!»);
if (ui->pz6->toPlainText ()≠"+").
{.
prog++;
ui->textBrowser2->setText (QString:number (prog));
ui->progressBar->setValue (prog*10);
ui->pz6->setText («+»);
}.
}.
}.
if (num==7).
{.
z7p=ui->plainTextEdit->toPlainText ();
QString z7="1*(4*(3*8−4*1)-8*(-6*0−4*8)+(-2)*(-6*1−3*8))-0*(7*(3*8−4*1)-8*(0*0−4*1)+(-2)*(0*0−3*1))+(-1)*(7*(-6*0−4*8)-4*(0*0−4*1)+(-2)*(0*8-(-6)*1))-3*(7*(-6*1−3*8)-4*(0*1−3*1)+8*(0*8-(-6)*1))" ;
s=1*(4*(3*8−4*1)-8*(-6*0−4*8)+(-2)*(-6*1−3*8))-0*(7*(3*8−4*1)-8*(0*0−4*1)+(-2)*(0*0−3*1))+(-1)*(7*(-6*0−4*8)-4*(0*0−4*1)+(-2)*(0*8-(-6)*1))-3*(7*(-6*1−3*8)-4*(0*1−3*1)+8*(0*8-(-6)*1));
for (i=0;i<=z7p.size ()&&f==true;i++).
if (z7p[i]≠z7[i]).
{.
ui->label2->setText («Mistake after»);
ui->label4->setText (QString:number (i));
ui->label5->setText («element!»);
f=false;
}.
if (z7p.size ().
{.
ui->label6->setText («You missed something or didn’t finish term»);
f=false;
}.
if (z7p.size ()>z7.size ()).
{.
ui->label6->setText («You wrote more then need. Check your derivation»);
f=false;
}.
if (s≠ui->textEdit2->toPlainText ().toInt ()).
{.
ui->label6->setText («Wrong answer. Check again»);
f=false;
}.
if (f==true).
{.
ui->label2->setText («Good job!»);
if (ui->pz7->toPlainText ()≠"+").
{.
prog++;
ui->textBrowser2->setText (QString:number (prog));
ui->progressBar->setValue (prog*10);
ui->pz7->setText («+»);
}.
}.
}.
if (num==8).
{.
z8p=ui->plainTextEdit->toPlainText ();
QString z8="0*(8*(3*(-2)-3*(-1))-0*(3*(-2)-3*0)+(-1)*(3*(-1)-3*0))-0*(1*(3*(-2)-3*0)-0*(-4*(-2)-3*16)+(-1)(-4*(-1)-3*16))+14*(1*(3*(-2)-3*0)-8*((-4)*(-2)-3*16)+(-1)*(-4*(-1)-3*16))-6*(1*(3*(-1)-3*0)-8*(-4*(-1)-3*16)+0*(-4*0−3*16))" ;
s=7162;
for (i=0;i<=z8p.size ()&&f==true;i++).
if (z8p[i]≠z8[i]).
{.
ui->label2->setText («Mistake after»);
ui->label4->setText (QString:number (i));
ui->label5->setText («element!»);
f=false;
}.
if (z8p.size ().
{.
ui->label6->setText («You missed something or didn’t finish term»);
f=false;
}.
if (z8p.size ()>z8.size ()).
{.
ui->label6->setText («You wrote more then need. Check your derivation»);
f=false;
}.
if (s≠ui->textEdit2->toPlainText ().toInt ()).
{.
ui->label6->setText («Wrong answer. Check again»);
f=false;
}.
if (f==true).
{.
ui->label2->setText («Good job!»);
if (ui->pz8->toPlainText ()≠"+").
{.
prog++;
ui->textBrowser2->setText (QString:number (prog));
ui->progressBar->setValue (prog*10);
ui->pz8->setText («+»);
}.
}.
}.
if (num==9).
{.
z9p=ui->plainTextEdit->toPlainText ();
QString z9="-5*(4*(3*8−4*1)-8*(-6*0−4*8)+(-2)*(-6*1−3*8))-7*(7*(3*8−4*1)-8*(0*0−4*1)+(-2)*(0*0−3*1))+(-16)*(7*(-6*0−4*8)-4*(0*0−4*1)+(-2)*(0*8-(-6)*1))-28*(7*(-6*1−3*8)-4*(0*1−3*1)+8*(0*8-(-6)*1))" ;
s=-5*(4*(3*8−4*1)-8*(-6*0−4*8)+(-2)*(-6*1−3*8))-7*(7*(3*8−4*1)-8*(0*0−4*1)+(-2)*(0*0−3*1))+(-16)*(7*(-6*0−4*8)-4*(0*0−4*1)+(-2)*(0*8-(-6)*1))-28*(7*(-6*1−3*8)-4*(0*1−3*1)+8*(0*8-(-6)*1));
for (i=0;i<=z9p.size ()&&f==true;i++).
if (z9p[i]≠z9[i]).
{.
ui->label2->setText («Mistake after»);
ui->label4->setText (QString:number (i));
ui->label5->setText («element!»);
f=false;
}.
if (z9p.size ().
{.
ui->label6->setText («You missed something or didn’t finish term»);
f=false;
}.
if (z9p.size ()>z9.size ()).
{.
ui->label6->setText («You wrote more then need. Check your derivation»);
f=false;
}.
if (s≠ui->textEdit2->toPlainText ().toInt ()).
{.
ui->label6->setText («Wrong answer. Check again»);
f=false;
}.
if (f==true).
{.
ui->label2->setText («Good job!»);
if (ui->pz9->toPlainText ()≠"+").
{.
prog++;
ui->textBrowser2->setText (QString:number (prog));
ui->progressBar->setValue (prog*10);
ui->pz9->setText («+»);
}.
}.
}.
if (num==10).
{.
ui->textBrowser3->show ();
z10p=ui->plainTextEdit->toPlainText ();
QString z10="1*(5*(0*(9*(2*(0*(5*(9*(0*0−4*2)-0*7*0−4*0)+0*(7*2−0*0))-0*(0*(0*0−4*2)-0*0*0−4*5)+0*(0*2)-0*5))+5*(0*(7*0−4*0)-9*(0*0−4*5)+0*(0*0−7*5))-*(0*0−4*2)-0*7*0−4*0)+0*(7*2−0*0))-0*(0*(0*0−4*2)-0*0*0−4*5)+0*(0*2)-0*5))+5*(0*(7*0−4*0)-9*(0*0−4*5)+0*(0*0−7*5))+*(0*0−4*2)-0*7*0−4*0)+0*(7*2−0*0))-0*(0*(0*0−4*2)-0*0*0−4*5)+0*(0*2)-0*5))+5*(0*(7*0−4*0)-9*(0*0−4*5)+0*(0*0−7*5)))" ;
s=6 038 082;
for (i=0;i<=z10p.size ()&&f==true;i++).
if (z10p[i]≠z10[i]).
{.
ui->label2->setText («Mistake after»);
ui->label4->setText (QString:number (i));
ui->label5->setText («element!»);
f=false;
}.
if (z10p.size ().
{.
ui->label6->setText («You missed something or didn’t finish term»);
f=false;
}.
if (z10p.size ()>z10.size ()).
{.
ui->label6->setText («You wrote more then need. Check your derivation»);
f=false;
}.
if (s≠ui->textEdit2->toPlainText ().toInt ()).
{.
ui->label6->setText («Wrong answer. Check again (answer: 6 038 082)»);
f=false;
}.
if (f==true).
{.
ui->label2->setText («Good job!»);
if (ui->pz10->toPlainText ()≠"+").
{.
prog++;
ui->textBrowser2->setText (QString:number (prog));
ui->progressBar->setValue (prog*10);
ui->pz10->setText («+»);
}.
}.
}.
if (prog==10).
ui->label10->setText («Congratulations! You know how to find the determinant of matrix. Good luck!»);
}.
void MainWindow: on_pushButton_pin_clicked ().
{.
int i;
bool prpin=true;
QString pin="2036″, pinp;
pinp=ui->textEdit_pin->toPlainText ();
for (i=0;i<4;i++).
if (pin[i]≠pinp[i]).
{.
ui->label_pin->setText («Wrong PIN! Try again.»);
prpin=false;
}.
if (prpin==true).
{.
ui->pushButton_ans->show ();
ui->pushButton_user->show ();
ui->label_pin->setText (««);
ui->pushButton_admin->hide ();
ui->pushButton_pin->hide ();
ui->label11->hide ();
ui->textEdit_pin->hide ();
ui->textEdit_pin->setText (««);
}.
}.
void MainWindow: on_pushButton_admin_clicked ().
{.
ui->pushButton_pin->show ();
ui->textEdit_pin->show ();
ui->label11->show ();
}.
void MainWindow: on_pushButton_user_clicked ().
{.
ui->pushButton_ans->hide ();
ui->pushButton_user->hide ();
ui->plainTextEdit->clear ();
ui->pushButton_admin->show ();
}.
void MainWindow: on_pushButton_ans_clicked ().
{.
int s;
int num = ui->plainTextEdit2->toPlainText ().toInt ();
if (num==1).
{.
ui->plainTextEdit->setPlainText («3*1−15*2»);
s=3*1−15*2;
ui->label3->setText (QString:number (s));
}.
if (num==2).
{.
s=0*132−4*(-2);
ui->plainTextEdit->setPlainText («0*132−4*(-2)»);
ui->label3->setText (QString:number (s));
}.
if (num==3).
{.
s=144*(-8)-132*(-11);
ui->plainTextEdit->setPlainText («144*(-8)-132*(-11)»);
ui->label3->setText (QString:number (s));
}.
if (num==4).
{.
s=5*(4*5−1*8)-1*(3*5−8*0)+6*(3*1−4*0);
ui->label3->setText (QString:number (s));
ui->plainTextEdit->setPlainText («5*(4*5−1*8)-1*(3*5−8*0)+6*(3*1−4*0)»);
}.
if (num==5).
{.
s=2*(0*9-(-1)*(-2))-(-3)*(0*9-(-2)*(-1))+11*(0*(-1)-0*5);
ui->label3->setText (QString:number (s));
ui->plainTextEdit->setPlainText («2*(0*9-(-1)*(-2))-(-3)*(0*9-(-2)*(-1))+11*(0*(-1)-0*5)»);
}.
if (num==6).
{.
s=11*((-1)*16−5*8)-(-6)*(0*16−5*4)+(-12)*(0*8-(-1)*4);
ui->label3->setText (QString:number (s));
ui->plainTextEdit->setPlainText («11*((-1)*16−5*8)-(-6)*(0*16−5*4)+(-12)*(0*8-(-1)*4)»);
}.
if (num==7).
{.
s=1*(4*(3*8−4*1)-8*(-6*0−4*8)+(-2)*(-6*1−3*8))-0*(7*(3*8−4*1)-8*(0*0−4*1)+(-2)*(0*0−3*1))+(-1)*(7*(-6*0−4*8)-4*(0*0−4*1)+(-2)*(0*8-(-6)*1))-3*(7*(-6*1−3*8)-4*(0*1−3*1)+8*(0*8-(-6)*1));
ui->label3->setText (QString:number (s));
ui->plainTextEdit->setPlainText («1*(4*(3*8−4*1)-8*(-6*0−4*8)+(-2)*(-6*1−3*8))-0*(7*(3*8−4*1)-8*(0*0−4*1)+(-2)*(0*0−3*1))+(-1)*(7*(-6*0−4*8)-4*(0*0−4*1)+(-2)*(0*8-(-6)*1))-3*(7*(-6*1−3*8)-4*(0*1−3*1)+8*(0*8-(-6)*1))»);
}.
if (num==8).
{.
s=7162;
ui->label3->setText (QString:number (s));
ui->plainTextEdit->setPlainText («0*(8*(3*(-2)-3*(-1))-0*(3*(-2)-3*0)+(-1)*(3*(-1)-3*0))-0*(1*(3*(-2)-3*0)-0*(-4*(-2)-3*16)+(-1)(-4*(-1)-3*16))+14*(1*(3*(-2)-3*0)-8*((-4)*(-2)-3*16)+(-1)*(-4*(-1)-3*16))-6*(1*(3*(-1)-3*0)-8*(-4*(-1)-3*16)+0*(-4*0−3*16))»);
}.
if (num==9).
{.
s=-5*(4*(3*8−4*1)-8*(-6*0−4*8)+(-2)*(-6*1−3*8))-7*(7*(3*8−4*1)-8*(0*0−4*1)+(-2)*(0*0−3*1))+(-16)*(7*(-6*0−4*8)-4*(0*0−4*1)+(-2)*(0*8-(-6)*1))-28*(7*(-6*1−3*8)-4*(0*1−3*1)+8*(0*8-(-6)*1));
ui->label3->setText (QString:number (s));
ui->plainTextEdit->setPlainText («-5*(4*(3*8−4*1)-8*(-6*0−4*8)+(-2)*(-6*1−3*8))-7*(7*(3*8−4*1)-8*(0*0−4*1)+(-2)*(0*0−3*1))+(-16)*(7*(-6*0−4*8)-4*(0*0−4*1)+(-2)*(0*8-(-6)*1))-28*(7*(-6*1−3*8)-4*(0*1−3*1)+8*(0*8-(-6)*1))»);
}.
if (num==10).
{.
s=6 038 082;
ui->label3->setText (QString:number (s));
ui->plainTextEdit->setPlainText («1*(5*(0*(9*(2*(0*(5*(9*(0*0−4*2)-0*7*0−4*0)+0*(7*2−0*0))-0*(0*(0*0−4*2)-0*0*0−4*5)+0*(0*2)-0*5))+5*(0*(7*0−4*0)-9*(0*0−4*5)+0*(0*0−7*5))-*(0*0−4*2)-0*7*0−4*0)+0*(7*2−0*0))-0*(0*(0*0−4*2)-0*0*0−4*5)+0*(0*2)-0*5))+5*(0*(7*0−4*0)-9*(0*0−4*5)+0*(0*0−7*5))+*(0*0−4*2)-0*7*0−4*0)+0*(7*2−0*0))-0*(0*(0*0−4*2)-0*0*0−4*5)+0*(0*2)-0*5))+5*(0*(7*0−4*0)-9*(0*0−4*5)+0*(0*0−7*5)))»);
}}.
void MainWindow: on_pushButton3_clicked ().
{.
ui->plainTextEdit->clear ();
ui->textEdit2->clear ();
ui->textEdit_pin->clear ();
ui->plainTextEdit2->clear ();
ui->textBrowser->clear ();
}.
- 9. Распечатка тестов и результатов работы программы
- 1. Ввод данных, правильное выполнение, показывает, что задание выполнено повторно, шкала прогресса, выполненные задания отмечены плюсом:
2. Неправильный ответ при правильном решении:
3. Сообщения об ошибках при верном ответе, но неправильном решении:
4. При полном выполнении, при выполнении 10 задания:
5. При неверном вводе номера: