# Can someone help with this C++ code. I am trying to compile and I keep running...

###### Question:

$Can someone help with this C++ code. I am trying to compile and I keep running into these 4 errors. include <iostream> include <cassert> include <string> using namespace std; typedef int fsm_state; typedef char fsm_input; bool is_final_state(fsm_state state) { return (state == 3) ? true : false; } fsm_state get_start_state(void) { return 0; } fsm_state move(fsm_state state, fsm_input input) { // our alphabet includes only 'a' and 'b' if (input != 'a' && input != 'b') assert(0); switch (state) { case 0: if (input == 'a') { return 1; } else if (input == 'b') { return 0; } break; case 1: if (input == 'a') { return 1; } else if (input == 'b') { return 2; } break; case 2: if (input == 'a') { return 1; } else if (input == 'b') { return 3; } break; case 3: if (input == 'a') { return 1; } else if (input == 'b') { return 0; } break; default: assert(0); } } bool recognize(string str) { if (str == "") return false; fsm_state state = get_start_state(); string::const_iterator i = str.begin(); fsm_input input = *i; while (i != str.end()) { state = move(state, *i); ++i; } if (is_final_state(state)) return true; else return false; } // simple driver for testing int main(int argc, char** argv) { recognize(argv[1]) ? cout < 1 : cout < 0; return 0; }$

#### Similar Solved Questions

##### Pls can you solve this exercise 29, and 30 active 4 E1-29 Using the accounting equation...
pls can you solve this exercise 29, and 30 active 4 E1-29 Using the accounting equation to analyze business transactions Ashley Stamper opened a medical practice. During July, the first month of operation, the business, titled Ashley Stamper, MD, experienced the followin cvents: Jul 6 9 12 15 20 ...
##### X ACCT 2302 quiz 3-1 When Homework 3 (Due Wednesday, January 30th by 11:59pm) POINTS n...
x ACCT 2302 quiz 3-1 When Homework 3 (Due Wednesday, January 30th by 11:59pm) POINTS n Mayer Company, the Cutting Department had beginning work in process of 6.000 unts, transterred out 24,000 unts, and had an encing work in process of 3,000 unts. How marry units were started by Moyer during the mo...
##### Case: Oubre v
Case: Oubre v. Entergy Operations, Inc.Question :Why do you think Oubre did not make restitution? What is Oubre is trying to achieve in trying to set aside her agreement to the severance package? Do you agree with the decision of the U.S. Supreme Court?...
##### Jacob undergoes an excision of a carotid body tumor. How is the procedure coded? Are any...
Jacob undergoes an excision of a carotid body tumor. How is the procedure coded? Are any modifiers attached?...
##### And X...,X, U[0,1], Given X...., X, are iid Y, is defined as Yn = min(x1,x2,...,x,). a.s. Prove that in Y, probabilit →...
and X...,X, U[0,1], Given X...., X, are iid Y, is defined as Yn = min(x1,x2,...,x,). a.s. Prove that in Y, probabilit → = 0 and Y. →=0...
##### Problem 4 (25 points) A 40 degree inclined water manometer is to measure a gauge pressure...
Problem 4 (25 points) A 40 degree inclined water manometer is to measure a gauge pressure of 5000 Pa in a system involving air. The differential length on the manometer is measured with accuracy of 0.5 mm and resolution of 1 mm. Density of air compared to density of water is negligible. Specific wei...
##### Hi, I have to take chemistry placement test for college this week
Hi, I have to take chemistry placement test for college this week. Does anyone here have advice for studying to prepare for the test? I took chemistry in high school 2 years ago so I don't remember anything....
##### 2 Ω 6A P2 10 Ω 5 Ω 4 Ω ΜΑ- 3Α
2 Ω 6A P2 10 Ω 5 Ω 4 Ω ΜΑ- 3Α...
##### How do you solve x^ { 5} + 3x ^ { 4} + 16x ^ { 3} + 48x ^ { 2} + 63x + 189= 0?
How do you solve x^ { 5} + 3x ^ { 4} + 16x ^ { 3} + 48x ^ { 2} + 63x + 189= 0#?...