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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 17:00, juandguardado7045
Your company has 1,500 desktop computers running windows 7. you want to upgrade them to windows 10. which type of microsoft license would be best suited in this situation?
Answers: 3
image
Computers and Technology, 23.06.2019 04:31, manlyman31
Selling a product through an electronic medium is
Answers: 1
image
Computers and Technology, 23.06.2019 13:30, juliajordan427
Best laptops for college [$100-$500 range]?
Answers: 2
image
Computers and Technology, 24.06.2019 05:30, lolololol21
Cómo pongo un tomo de llamada sin pagar?
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 in other subjects: