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, 23.06.2019 05:00
Which best explains why a digital leader would join a society specializing in technology
Answers: 1
question
Computers and Technology, 23.06.2019 09:00
The first screen you see when you open word2016 what is called?
Answers: 1
question
Computers and Technology, 23.06.2019 09:30
The place where the extended axis of the earth would touch the celestial sphere is called the celestial
Answers: 1
question
Computers and Technology, 23.06.2019 17:30
What are the most commonly found items in the trash according to the municipal solid waste report?
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
Physics, 29.01.2021 19:00
question
Mathematics, 29.01.2021 19:00
question
Mathematics, 29.01.2021 19:00
Questions on the website: 13722361