subject

Problem Statement EIGER is a brand-new, made-up computer language. It's very exciting, and very simple! EIGER only allows the programmer to do two things: define a name for an integer, and compare two names. Write a metaprogram - a program which can simulate the EIGER language.
For this problem, you will write a complete program that takes its input from stdin and outputs the answer to stdout. Your input will be a program in EIGER, and the output is simply the outputs of the program.
Each line of input contains one command. A definition command has the form
define i x
where i is an integer in the range [-100, 100], and x is a string of up to 20 lowercase alphabet characters (a-z).
A comparison command has the form
eval x comp y
where x and z are strings of the same format as in definitions, and comp is one of <, >, or =.
For each definition, use the string as a label for the given integer but don't output anything. Redefinitions are allowed. For each comparison, state whether it is true or false, depending on the current definitions. If the result is not known, output 'undefined.
Constraints
. All programs will have between 1 and 100 lines of commands.
Examples
1. define -78 argon
eval argon> argon
Output:
false
2. define -62 x define -28 2
eval y > 2
Output:
undefined
3. define 46 purple
eval purple blue
eval purple -purple
define 3 orange define 77 yello
define-76 violet
define 42 violet
eval gray orange
define 16 yellow
eval yellow- gray
eval violet < purple
eval violet < yellow
Output:
undefined
true
undefined
undet ined
true
false
1 Winclude
2
3 using namespace std;
4
5 - int main() {
6 // fill in code here
7 }
8

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 18:30
Which number on the image above correctly indicates the name of a folder in this url? a.1b.2c.3d.4
Answers: 2
question
Computers and Technology, 22.06.2019 05:10
Suppose we have a byte addressable computer that has a 32-byte cache with 8 bytes per block. the memory address is 8 bits long. the system accesses memory addresses (in hex) in this exact order: 6e, b9, 17, e0, 4e, 4f, 50, 91, a8, ab, ad, 93, and 94. (a) assuming the cache is direct mapped, what memory addresses will be in cache block 2 after the last address has been accessed? (b) assuming the cache is direct mapped, what is the hit ratio for the entire memory reference sequence given, assuming the cache is initially empty? (c) assuming the cache is 2-way set associative with a lru replacement policy, what is the hit ratio?
Answers: 3
question
Computers and Technology, 22.06.2019 16:10
When copying and pasting text, the first step is move your cursor type the text select the copy command select the paste command
Answers: 2
question
Computers and Technology, 22.06.2019 20:00
Which type of file can be used to import data into a spreadsheet?
Answers: 1
You know the right answer?
Problem Statement EIGER is a brand-new, made-up computer language. It's very exciting, and very si...
Questions
question
History, 21.09.2021 14:00
question
Mathematics, 21.09.2021 14:00
question
Computers and Technology, 21.09.2021 14:00
question
Biology, 21.09.2021 14:00
question
Mathematics, 21.09.2021 14:00
question
Mathematics, 21.09.2021 14:00
Questions on the website: 13722367