Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
nmx::apps::x017::TestUI Class Reference

The TestUI class Test mit rationalen Zahlen Benutzerschnittstelle. More...

#include <x017.h>

Public Types

using Rational = nmx::apps::x017::Rational
 
using Test = nmx::apps::x017::TestGenerator< Rational >
 

Public Member Functions

 TestUI (size_t maxq, const Test::DataC &data)
 TestUI Konstruktor. More...
 
void run ()
 run Interaktion mit dem Benutzer More...
 
Rational read (const std::string &answer)
 read Lese Antwort des Benutzers More...
 

Static Public Member Functions

static std::string to_string (const Test::Question &q)
 to_string Umwandlung Frage in Zeichenkette More...
 

Public Attributes

Test test
 
size_t _score = 0
 
const size_t _maxScore
 

Static Public Attributes

static const std::array< std::string, 4 > ops { "+", "-", "*", "/" }
 

Detailed Description

The TestUI class Test mit rationalen Zahlen Benutzerschnittstelle.

Definition at line 159 of file x017.h.

Member Typedef Documentation

◆ Rational

Definition at line 162 of file x017.h.

◆ Test

Definition at line 163 of file x017.h.

Constructor & Destructor Documentation

◆ TestUI()

nmx::apps::x017::TestUI::TestUI ( size_t  maxq,
const Test::DataC data 
)
inline

TestUI Konstruktor.

Parameters
maxqAnzahl der Fragen
dataContainer mit rationalen Zahlen

Definition at line 180 of file x017.h.

Member Function Documentation

◆ read()

Rational nmx::apps::x017::TestUI::read ( const std::string &  answer)
inline

read Lese Antwort des Benutzers

Parameters
answerAntwort des Benutzers (Zeichenkette)
Returns
Antwort des Benutzers als rationale Zahl

Definition at line 246 of file x017.h.

◆ run()

void nmx::apps::x017::TestUI::run ( )
inline

run Interaktion mit dem Benutzer

Definition at line 187 of file x017.h.

◆ to_string()

static std::string nmx::apps::x017::TestUI::to_string ( const Test::Question q)
inlinestatic

to_string Umwandlung Frage in Zeichenkette

Parameters
qFrage
Returns
Frage als Zeichenkette

Definition at line 232 of file x017.h.

Member Data Documentation

◆ _maxScore

const size_t nmx::apps::x017::TestUI::_maxScore

Definition at line 172 of file x017.h.

◆ _score

size_t nmx::apps::x017::TestUI::_score = 0

Definition at line 170 of file x017.h.

◆ ops

const std::array< std::string, 4 > nmx::apps::x017::TestUI::ops { "+", "-", "*", "/" }
inlinestatic

Umwandlung der Operatoren +,-,*,/ in Zeichenketten

Definition at line 168 of file x017.h.

◆ test

Test nmx::apps::x017::TestUI::test

Definition at line 166 of file x017.h.


The documentation for this class was generated from the following file: