| | |
Can anybody pls help me writing c or c++ or java code for this program?
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: May 2007
Posts: 1
Reputation:
Solved Threads: 0
Build a hash table using chaining as the collision resoultion technique. Insertions into the hash table will correspond to declarations of variables and values in a program, searches will be requests for the value of a variable. Some variables will be local and have a narrow scope while some variables will be global.
The program will take input from a file, another program written in the omnipotent programming language BORG (Bionicly Omnipotent Resistance Grinders) and generate ouput from this program.
The BORG language has the following commands (keywords):
ie. The variable ABC = (65 * 1 + 66 * 2 + 67 * 3) % TABLESIZE
All tokens are seperated by one space or a new line.
Output: for this , run your interpreter on this sample source program as well as a program of your own, and turn it the output from both, as well as the source code from your BORG program as well as source code of the assignment and its executable. Zip is good.
may implement one additional feature to the language, such as adding if, methods, more capable print statements. Only one student may implement a given extension to the language, and each extension must first be cleared with me.
Sample program and its output:
Input
COM HERE IS OUR FIRST BORG PROGRAM
COM WHAT A ROBUST LANGUAGE IT IS
START
BORAMIR = 25
LEGOLAS = 101
PRINT BORAMIR
BORAMIR ++
PRINT LEGOLAS LEGOLAS IS 25
PRINT BORAMIR * 2
COM
COM NESTED BLOCK
COM
START
GANDALF = 49
PRINT GANDALF
PRINT BORAMIR
FINISH
PRINT GANDALF
START
LEGOLAS = 1000
PRINT LEGOLAS
FINISH
PRINT LEGOLAS
LEGOLAS --
PRINT LEGOLAS
FINISH
OUTPUT
Output
BORAMIR IS 25
LEGOLAS IS 25
GANDALF IS UNDEFINED
BOARAMIR * 2 IS 50
GANDALF IS 49
BORAMIR IS 25
GANDALF IS UNDEFINED
LEGOLAS IS 1000
LEGOLAS IS 101
LEGOLAS IS 101
CAn anybody write code for this program?
Thank uu
The program will take input from a file, another program written in the omnipotent programming language BORG (Bionicly Omnipotent Resistance Grinders) and generate ouput from this program.
The BORG language has the following commands (keywords):
- START-FINISH blocks. Indicating different scopes.
- COM - Single line comments: Text should be ignored if on the same line
- value = expression – Assignment statements, ie GEORGE = 122. This language is not option explicit, so the statement GEORGE = 122 will put a variable into the table and associate the value 122 with it.
- ++ - increment operator, syntax: VARIABLE ++
- -- - decrement operator, syntax: VARIABLE --
- expressions, expressions are limited to unary and binary arithmatic, or variable names
- supported operators: + - / * % ^ (plus, minus, divide, multiple, modulo, exponent)
- PRINT – syntax PRINT expression. If the expression is a variable, and this variable is not in scope, then an error message indicating unknow variable x at line number y. The value printed if there is a variable in scope should be the variable with the closest scope.
- errors – other than the print statements, our interpreter will not be responsible for detecting errors, syntax errors should be disregarded if encountered, assume that the source file is correct.
ie. The variable ABC = (65 * 1 + 66 * 2 + 67 * 3) % TABLESIZE
All tokens are seperated by one space or a new line.
Output: for this , run your interpreter on this sample source program as well as a program of your own, and turn it the output from both, as well as the source code from your BORG program as well as source code of the assignment and its executable. Zip is good.
may implement one additional feature to the language, such as adding if, methods, more capable print statements. Only one student may implement a given extension to the language, and each extension must first be cleared with me.
Sample program and its output:
Input
COM HERE IS OUR FIRST BORG PROGRAM
COM WHAT A ROBUST LANGUAGE IT IS
START
BORAMIR = 25
LEGOLAS = 101
PRINT BORAMIR
BORAMIR ++
PRINT LEGOLAS LEGOLAS IS 25
PRINT BORAMIR * 2
COM
COM NESTED BLOCK
COM
START
GANDALF = 49
PRINT GANDALF
PRINT BORAMIR
FINISH
PRINT GANDALF
START
LEGOLAS = 1000
PRINT LEGOLAS
FINISH
PRINT LEGOLAS
LEGOLAS --
PRINT LEGOLAS
FINISH
OUTPUT
Output
BORAMIR IS 25
LEGOLAS IS 25
GANDALF IS UNDEFINED
BOARAMIR * 2 IS 50
GANDALF IS 49
BORAMIR IS 25
GANDALF IS UNDEFINED
LEGOLAS IS 1000
LEGOLAS IS 101
LEGOLAS IS 101
CAn anybody write code for this program?
Thank uu
Last edited by honeysmiles; May 2nd, 2007 at 12:05 am.
What do you need help with? Nobody's going to do your homework for you; you need to ask yourself why you can't do this yourself and then figure out specific questions that will help you to solve the problem yourself.
If you want somebody to write the whole thing for you, offer money. But even then the person might turn you in to your professor.
In fact, searching on Google gives matches at Rent-A-Coder.
If you want somebody to write the whole thing for you, offer money. But even then the person might turn you in to your professor.
In fact, searching on Google gives matches at Rent-A-Coder.
Last edited by Rashakil Fol; May 2nd, 2007 at 12:02 am.
All my posts may be redistributed under the GNU Free Documentation License.
•
•
•
•
In fact, searching on Google gives matches at Rent-A-Coder.
And to think I have been working my buns off for the last 20 years when I could have been drinking a beer while letting RentACoder do my work. I would hope universities will expell any student who does that. Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
![]() |
Similar Threads
- Executing Shell script from Java code. (Java)
- Move out java code from jsp (Java)
- Thinking OOP!: From BASIC to JAVA (Java)
- wrong output in c program (C++)
- Help with Java code (Java)
- Can N E 1 Help!!!! -- Need sample Java code (Java)
- java code newbie (Java)
Other Threads in the C++ Forum
- Previous Thread: Vending Machine Program using Arrays please help!
- Next Thread: the common usage of a copy constructor
| Thread Tools | Search this Thread |
api array beginner binary bitmap c++ c/c++ calculator char char* class classes coding compile compiler console conversion count data database delete desktop developer directshow dll download dynamic email encryption error file forms fstream function functions game getline google graph gui homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return rpg sorting string strings struct template templates test text text-file tree unix url vector video visualstudio win32 windows winsock word wordfrequency wxwidgets






