Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

create a C++ program that parses a file and for each string it finds (strings are separated by whitespace) outputs the string and which of

create a C++ program that parses a file and for each string it finds (strings are separated by whitespace) outputs the string and which of the above languages it is a member of. If the string is not a member of any, then it outputs 'none'. For organizational reasons, make a boolean function for each of the languages. Please provide appropriate and helpful comments.

Example Run: File: test.txt Abcde: Id aAa9: Id 3422222: Num ;: Semicolon wHile: Id while: Id, While &&: And 8eo: none &: none ;asdf: none

the languages are

(a) Id = {w | w is a string beginning with A...Z,a...z and followed by any character in the alphabet}. The alphabet is ={0. ..9 , A... Z , a... z } (b) Num = {w | w contains 0...9}, The alphabet is ={0,. .. , 9} . (c) Semicolon = {w | w is the string ';'}, The alphabet is ={; } . (d) And = {w | w is the string '&&'}, The alphabet is = {&}. (e) While = {w | w is the string 'while'}, The alphabet is ={w , h , i , l , e }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases DeMYSTiFieD

Authors: Andy Oppel

2nd Edition

0071747990, 978-0071747998

More Books

Students also viewed these Databases questions

Question

=+Do you want to work from home?

Answered: 1 week ago

Question

=+ What skills and competencies will enable someone

Answered: 1 week ago

Question

=+to live and work wherever he or she wants?

Answered: 1 week ago