Year / University: Fall 2009 / IIIT-B
Grade: A
Instructor: Prof. Chopella
Following are the assignments and projects done as part of this course.
Java Script Based Online Spread Sheet Application
The project aims to create an online spread sheet application where users can add / delete rows & columns, perform arithmetic operations, evaluate expressions, summations, etc. The users can save their work and retrieve it later. Developed using Java script, Ajax, Html, JSON and Yahoo User Interface (YUI) libraries. For data persistence, we use a java script based server like ‘Plain Old Webserver’ or ‘Browser Server’. The input to the cells of the spreadsheet accepts the following grammar,
Input Grammar (BNF)
Number :: = range(0-9)
Operators::=+, *, -, /,
Alpha ::= range(A-Z)|range(a-z)
Address :: = sequence(repeat1(Alpha),Number)
Expression ::= wsequence(“(”,Operators, Address|Number|Expression, Address|Number|Expression, “)”)
Keywords ::= “SUM”|”PROD”
Functions ::= wsequence(“(“,Keywords, Address, Address, “)”)
Formula ::= Number|Address|Expression|Functions
For example, an expression could be (+ 2 3), which evaluates to 5. It could also be a nested expression like (* 3 (+ 4 5)) which evaluates to 27. Cell addresses are specified as <col num><row name >, for example, A1 represents cell at column A and row 1. Hence an expression that uses cell address could be (+ A1 4).
Downloads: Source Code Implementation Details Screenshot Design Document
Click Here to access this app. [Note: Some of the features (save, open, auto save) have been disabled]
Following is a demo of the project.
Assignments in Scheme and Java-script
- Implementation and validation of a mutable two-dimensional Point datatype.
[ Download Scheme ] [ Download JS ]
- Implementation of a datatype to define an expression- Exp :: = numExp(n: Number) | plusExp(operand1: Exp, operand2: Exp).
[ Download Scheme ] [ Download JS ]
- Tail Recursive and Iterative programs on lists. Implement a function which takes a list 'ls' and an value 'x' and checks whether x exists in ls.
[ Download Scbeme ] [ Download JS ]
- A program that takes a function 'f' and a natural number 'n' as input and returns the nth iterate of f.
[ Download Scheme ] [ Download JS ]
- Design of the function - braid. Braid takes two lists ls1 and ls2 and returns a new list whose elements are alternately taken from ls1 and ls2. Elements remaining from the longer list after braiding are copied without change.
[ Download Scheme ] [ Download JS ]
- Implement a function that takes a list ls and an element x and returns a new list which is equivalent to the old list except that all occurrences of the element x are removed.
[ Download Scheme ] [ Download JS ]
- Recursively reverse the contents of a list.
[ Download Scheme ] [ Download JS ]
- Define functions list-sum (and list-product, respectively) recursively that sum (and multiply, respectively) all the elements of a list of numbers.
[ Download Scheme ] [ Download JS ]
- Define functions list-every and list-some that takes a predicate p and a list ls, and returns #t if every (respectively, some) element of ls satisfies p, #f otherwise.
[ Download Scheme ] [ Download JS ]
- Define a recursive function 'list-reduce' which takes a seed value 'a', binary function 'p', and a list 'ls' of values and reduces the list to a value according to the following pattern. (list-reduce seed p '(a b c)) = (p a (p b (p c seed))). In addition, use list-reduce to define the following functions described above - list-sum, list-product, list-every and list-some.
[ Download Scheme ] [ Download JS ]
Lecture Notes, Practice Snippets and Reading Material
Click here to browse and download.