Programming > Research Paper > Irvine Valley CollegeCS 41CS41Assignment4.java (All)
/* The program will take input from a file, another program written in the omnipotent programming language BORG (Bionicly Omnipotent Resistance Grinders) and generate output from this program. 1... . STARTFINISH blocks. Indicating different scopes. 2. COM Single line comments: Text should be ignored if on the same line 3. VAR varName varName Assignment statements, ie GEORGE = 122. Find GEORGE in the hash table and assign 122 to it. 5. ++ increment operator, syntax: VARIABLE ++ 6. decrement operator, syntax: VARIABLE 7. expressions, expressions are limited to unary and binary arithmetic, or variable names 8. supported operators: + / * % ^ (plus, minus, divide, multiple, modulo, exponent) 9. PRINT 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. */ package cs41.assignment4; import java.io.File; import java.io.FileNotFoundException; import java.util.Hashtable; import java.util.Scanner; /* */ public class CS41Assignment4 { static int TABLESIZE = 37; /*Intialize an array size of 37*/ static int Hashing(String chars) { int hash = 0; for (int i = 0; i < chars.length(); i++) { hash += chars.charAt(i) * (i + 1); } return hash % TABLESIZE; /* return the index in the hash table */ } public static void main(String[] args) throws FileNotFoundException { [Show More]
Last updated: 1 year ago
Preview 1 out of 9 pages
Connected school, study & course
About the document
Uploaded On
May 20, 2021
Number of pages
9
Written in
This document has been written for:
Uploaded
May 20, 2021
Downloads
0
Views
60
In Browsegrades, a student can earn by offering help to other student. Students can help other students with materials by upploading their notes and earn money.
We're available through e-mail, Twitter, Facebook, and live chat.
FAQ
Questions? Leave a message!
Copyright © Browsegrades · High quality services·