Question: QT C++ The checkstationcode (QString stn) function from the class definition in 2.2 is used to ensure that the station code meets the correct format

 QT C++ The checkstationcode (QString stn) function from the class definition

QT C++

The checkstationcode (QString stn) function from the class definition in 2.2 is used to ensure that the station code meets the correct format required, where the QString parameter is the station code that needs checking. The returned Boolean is trie if the code meets requirements and false otherwise. bool RainXm2 : :checkstationcode (estring stn) const I/ add code here + The station code should meet the following requirements. - Should begin with a capital letter. - This is followed by any 2 lowercase alphabetic characters. - This is followed by the same capital letter as the initial character of the code. - The numeric part of the code is made up of any 3 digits, where the first digit cannot be zero. - There should be no other characters before or after this code. 2.3.1 Write the QRegularExpression that would be used to check codes for correctness. QRegularexpression. re(/*wat would you put here*/); 2.3.2 Which anti-pattern would be involved if the code were not checked for meeting requirements? 2.3.3 Provide the code for the checkstationcocelestring s=n) function assuming that QRegularEzpression re, defined in 2.3.1, is a data member of the RainXm1 class. (2)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!