Menu

[Solved]Write Code C Inputs Part 1 Following Input File Foreign Students Name Well Know Comics Lar Q37159559

Write code in c++ only

Inputs from part 1:

We have the following input file: (for foreign students the namehere are of well know comics)

larry = 27

curly = 19

moe = 8

groucho = 11

harpo = larry+curly

harpo = larry-curly

harpo = larry*curly

harpo = larry/curly

harpo = larry*curly+moe*groucho

You will be writing a program for PDA When the file in Q 1 is input, the output should say that it is a valid file. Now chang

You will be writing a program for PDA When the file in Q 1 is input, the output should say that it is a valid file. Now change one line firom harpo -lary +curly harpo lary+tcurly The program should say that it is invalid. Here is the grammar for the PDA G- [V,T,S,P) T-fidentu {0-9,+,-,*,ラ;} } Seprogram> Production rules are <begin> →begin<stmtList» end <factor>-^IntLit lident The PDA for this grammar is q0 as the starting state, ql as the intermediate state and q2 as the accepting state The transition rules are (g0, I)-l,^program>) (ql IntListIntlit) -ql) (gl, -factor») → (ql, ident) (al, λ, ctemn) (gl, term»*<factor>) (ql, 1 tem)-(l, <factor>) (gl. <program») → (gl , begmestnti istend) (ql, 1 iden)-> (ql, ident) Show transcribed image text You will be writing a program for PDA When the file in Q 1 is input, the output should say that it is a valid file. Now change one line firom harpo -lary +curly harpo lary+tcurly The program should say that it is invalid. Here is the grammar for the PDA G- [V,T,S,P) T-fidentu {0-9,+,-,*,ラ;} } Seprogram> Production rules are →begin) (ql IntListIntlit) -ql) (gl, -factor») → (ql, ident) (al, λ, ctemn) (gl, term»*) (ql, 1 tem)-(l, ) (gl. (ql, ident)

Expert Answer


Answer to Write code in c++ only Inputs from part 1: We have the following input file: (for foreign students the name here are of … . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *