Question: Write a recognizer in C++ for L = {x | x is a binary number} [10 pts] My recognizer.cpp must be used. main: Given a
Write a recognizer in C++ for L = {x | x is a binary number} [10 pts]
My recognizer.cpp must be used.
main: Given a string (from E) cined from the user, pass it to
the recognizer function.
Cout YES IN L or NO NOT IN L depending on what was returned.
recognizer function: Should return TRUE or FALSE checking each character
to make sure it is 0 or 1. (leading 0s are allowed).
Testing: test with 0, 1, 00110, 2, 02, 31 in this order. Routput.txt
Given Code:
#include
//------------------------------------------------------- // Write a recognizer in C++ for L = {x | x is a binary number}. //-------------------------------------------------------
// The recognizer function should return TRUE or FALSE // checking each character // to make sure it is 0 or 1. (leading 0's are allowed). bool recognizer(string s) { ** }// end of recognizer
//main: Given a string (from E) cined from the user, pass it to // the recognizer function. // Cout YES IN L or NO NOT IN L depending on what was returned. int main() { **
// feel free to put it in a loop
}// end of main
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
