Question: Question 2 ( 2 2 points ) : Purpose: To build a simple interpret and test it . To get warmed up with Python, in
Question 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
References: You may wish to review the following chapters:
General: CMPT Readings, Chapter
File IO Review. CMPT Readings: Chapter be distributed to any person except by the instructors of CMPT Solutions will pedagogicale available to students registered in CMPT after the due date. The team to provide solutions to this question for tutors or experts outside the CMPT 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: alq asks about your work on aq 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 and your answer will be you will be asked to summarize the time you spend working on alq and your you start Q 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 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, eg ASK. Commands sometim eg
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
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
