Question: Question 2 ( 2 2 points ) : Purpose: To build a simple interpret and test it . To get warmed up with Python, in

Question 2(22 points):
Purpose: To build a simple interpret and test it. To get warmed up with Python, in case you are using it for the first time.
Degree of Difficulty: Easy. This is just for fun, and to emphasize some of the ideas of Chapter 1
References: You may wish to review the following chapters:
General: CMPT 145 Readings, Chapter 1
File IO Review. CMPT 141 Readings: Chapter 12 be distributed to any person except by the instructors of CMPT 145. Solutions will pedagogicale available to students registered in CMPT 145 after the due date. The team to provide solutions to this question for tutors or experts outside the CMPT 145 instructionalicit such solutions are committing an action to a student registered in the course. Students who solicit such solicy on Academic Miscond of Academic Misconduct, according to the University of Saskatchewan Pol
Note: alq3 asks about your work on a1q2 tion, reviewing notes and the course readings, implementing the solution, testing, and preparing to submit. Also keep track of how many times you experienced unscheduledinterruptions, delays calls, ter distractions during your work; include things like social or from the university. In things as breaking for a meal, exercise, commuting to 192, and your answer will be m you will be asked to summarize the time you spend working on alq2, and your you start Q2? you if you have more precise records. Maybe go and read
A simple calculating language: Tho The end goal of this question is
very simple calculating language called open a file, read the commands that are in the file, perform the calYour Python program will be able to open a fesult. The file can be considered a program or a script in the culations, and will output the numerical result the Tho script will be considered a very simple Tho interpreter. Tho Register The language is not like Python. In Python, we calue can be modified by the Tho commands. Tho language will use exactly one register, called R, wister is in to be zero. Tho commands The commands of the Tho language are not we only have very simple commands. Each ments and expressions, and loops and functions, etc. In Tho, for a very simple kind of CPU. command is rather like an instruction in assembly lange of the commands, and then clearly describe the To describe the commands, we have to give the syntax of that follows, the command keywords will be behaviour or effect of the commands. In the descriptione an argument, which depends on that the script written in upper case, e.g., ASK. Commands sometim e.g.T.
is trying to do. For arguments, we will use italics eript Usually, an argument will be a floating point number.
There are only two kinds of arguments for a Tho script usument. A name is simply a letter or work, similar to Sometimes, a Tho command will use a name with the user. names in Python.
We'll start with the ASK and TELL commands, which Tho uses to interact with
 Question 2(22 points): Purpose: To build a simple interpret and test

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!