Assignment 4: Integrating the earlier assignments into a simple spreadsheet
In Assignment 4: you will implement the backend, type-check the operations, and integrate the entire work.
You will need to check that the operations on rows, columns and ranges (especially in type 2 operations) are of consistent dimensions (two ranges being added should be of the same size).
You need to write clear specifications of the OCaml functions which you implement, and document your code.
Backend
In order to evaluate the above functions, you might want to implement the following in OCaml:
- full count: sheet -> range -> index -> sheet : Fills count of valid entries in the given range into the specified cell
- row count: sheet -> range -> index -> sheet : Fills count of valid entries per row in the given range into the column starting from the specified cell col count: sheet -> range -> index -> sheet : Fills count of valid entries per column in the given range into the row starting from the specified cell.
- full sum: sheet -> range -> index -> sheet : Fills the sum of entries of cells in the given range into the specified cell
- row sum: sheet -> range -> index -> sheet : Fills the sum of entries of cells per row in the given range into the column starting from the specified cell
- col sum: sheet range index -> sheet : Fills the sum of entries of cells per column in the given range into the row starting from the specified cell
- full avg: sheet range index -> sheet Fills the average of entries of cells in the given range into the specified cell
- row avg: sheet range index -> sheet : Fills the average of entries of cells per row in the given range into the column starting from the specified cell col avg: sheet range index -> sheet Fills the sum of entries of cells per column in the given range into the row starting from the specified cell
- full min: sheet -> range -> index -> sheet : Fills the min of entries of cells in the given range into the specified cell
- row min: sheet -> range -> index -> sheet : Fills the min of entries of cells per row in the given range into the column starting from the specified cell col min: sheet -> range -> index -> sheet : Fills the min of entries of cells per column in the given range into the row starting from the specified cell
- full max: sheet -> range -> index -> sheet : Fills the max of entries of cells in the given range into the specified cell
- row max: sheet -> range -> index -> sheet : Fills the max of entries of cells per row in the given range into the column starting from the specified cell col max: sheet -> range -> index -> sheet : Fills the max of entries of cells per column in the given range into the row starting from the specified cell
- add const: sheet -> range -> float -> index -> sheet : adds a constant to the contents of each cell in the selected cell range
- subt const: sheet -> range -> float -> index -> sheet : subtracts a constant from the contents of each cell in the selected cell range mult const: sheet -> range -> float -> index -> sheet : multiplies the contents of each cell in the selected cell range by a constant.
- div const: sheet -> range -> float -> index -> sheet : divides the contents of each cell in the selected cell range by a constant.
- add range: sheet -> range -> range -> index -> sheet : adds the cell contents for each corresponding pair of cells in two selected cell ranges
- subt range: sheet -> range -> range -> index -> sheet : performs a subtraction on the cell contents for each corresponding pair if cells in two selected cell ranges mult range: sheet -> range -> range -> index -> sheet : multiplies the cell contents for each corresponding pair of cells in two selected cell ranges
- div range: sheet -> range -> range -> index -> sheet : performs a division on the cell contents for each corresponding pair of cells in two selected cell ranges
Reviews
There are no reviews yet.