Giter Club home page Giter Club logo

spreadsheet's Introduction

#SpreadSheet

This exercise aims at creating a basic spreadsheet. The goal is not to develop the user interface, but the code that implements the data structures and performs the operations. The spreadsheet follows Excel's conventions. The spreadsheet implements three operations: set(), get() and evaluate(). Set and get assign and return cell's values. Evaluate takes the cell's content and returns the result (e.g.: a cell containing โ€œ=1+1โ€ evaluates to 2).

  • The spreadsheet should handle correctly formatted integer numbers both signed and unsigned, so that when a cell containing an integer number is evaluated, the result of the evaluation shall be the number itself. When a number does not follow the integer format (e.g.: contains a decimal point, special symbols, characters, etc.), the evaluation shall return the message #Error.

  • The spreadsheet shall be able to store and return strings entered between single quotes. When a cell containing a string is evaluated, the result of the evaluation shall be the same string without quotes. Therefore, when a string does not have heading or trailing quotes, the evaluation shall return the message #Error.

  • The spreadsheet evaluates simple formulas (e.g., without operators or cell references). A formula starts with '=' followed by a string or integer number, the evaluation of that cell shall return the corresponding string or integer. When a cell contains a '=' sign, followed by a wrong string or integer number the evaluation of that cell shall return the message #Error.

  • A formula can contain a reference to a cell (following Excel convention, e.g.: A5). In such case the evaluation shall be recursive, i.e.: the referenced cell is evaluated, and the result is returned by the formula. When the value contained in a cell referenced by a formula is incorrect, the evaluation shall return the message #Error. There could be cases in which the formula contains circular references (e.g.: A5 contains a formula referencing A1, and A1 contains a formula referencing A5). In this case the evaluation shall return the message #Circular.

  • The spreadsheet performs integer addition, subtraction, multiplication, division, and module when the corresponding operators (+ - * / %) are present in a formula. In such cases the formulas are always evaluated from left to right (e.g., usual operator precedence does not apply). When an operation cannot be performed because (1) the operators are incorrect integer numbers or (2) there is a division by zero, the evaluation shall return the message #Error.

  • A formula containing & performs the concatenation of strings. A concatenation cannot be performed when the strings are wrongly formatted. In this case the evaluation shall return the message #Error.

  • A formula can contain parentheses, if that's the case the part within the parentheses shall be evaluated first (e.g., Formula "=1+(1*2)" evaluates to "3"). If the parentheses in a formula are unbalanced, it shall return the message #Error.

  • Finally, formulas can contain arbitrary spaces which are to be ignored (e.g., Formula "=1+ (1 * 2 )" evaluates to "3")

https://github.com/M3SOulu/SpreadSheet

PLEASE COMPLETE THE QUESTIONNAIRE AT: https://goo.gl/forms/jesnxyN1IfFNSRrq2

spreadsheet's People

Contributors

dfucci avatar

Watchers

 avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.