Пример #1
0
void QuestionSetCubics::initQuestions( Question::List &questions )
{
  for( int b = 1; b <= 10; ++b ) {
    Question q;
    q.setQuestion( QString::number( b ) + " cube" );
    q.setAnswer( QString::number( b * b * b ) );
    questions.append( q );
  }
}
void QuestionSetMultiplication::initQuestions( Question::List &questions )
{
  QValueList<int> rows = Prefs::multiplicationRows();
  QValueList<int>::ConstIterator it;
  for( it = rows.begin(); it != rows.end(); ++it ) {
    int a = *it;
    for( int b = 1; b <= 10; ++b ) {
      Question q;
      q.setQuestion( QString::number( b ) + " \xb7 " + QString::number( a ) );
      q.setAnswer( QString::number( a * b ) );
      questions.append( q );
    }
  }
}