407144: GYM102697 115 Pseudocode Compiler
Description
In this question your goal is to make a program that will simulate running some pretty basic pseudocode. Here is the syntax that will be used:
Defining a variable: -"var variableName = value" -value can be any integer -value can be a simple math equations ex: "3 + 5" -value can be a simple math equation that includes a variable "testVar + 2"
Manipulating a variable: -"variableName = value" -same rules applied to what the value can be as the one above -Ex: "test1 = test1 + 2 - test2"
Printing: -"print (hello word )+exampleVariable+" -text that is being printed will be surrounded in parentheses -variables being printed will be surrounded in addition signs
InputThe first line will be the number of lines of code. The next X number of lines will be the code that you need to simulate.
OutputPrint whatever the program prints.
ExampleInput6 print (hello world) var a = 5 a = a - 1 var b = a + 3 var c = a + b print +a+( + )+b+( = )+c+Output
hello world 4 + 7 = 11