Question: Write a program in python Create the following text file: finalv 1 . txt program s 2 0 2 4 ; / / This
Write a program in python
Create the following text file: "finalvtxt
program s;
This program computes and prints the value
of an expression
var
declare variables
: integer ;
begin
;
;
write ; display pl
compute the value of this expression
;
write value pp ; print the value of pp
end.
Apply the following rules to this file and copy the new version in the file "finaltxt to make it easier to read one token at a time. ie lines # remove them all.
b Remove all blank linesie line #
c Extra spaces in each line must be removed, leave one space before and one after each token to make tokenization easier.
The "finalftxt should look like this
program s;
var
: integer ;
begin
;
;
;
;
write ; display
;
write value pp ; print the value of
end.
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
