GithubHelp home page GithubHelp logo

mansi-k / ssd_assignment3 Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 421 KB

Assignment 3 for the course Software Systems Development @ IIITH

Python 100.00%
cyclomatic-complexity date-calculator common-leader common-slot

ssd_assignment3's Introduction

SSD Assignment-3

Question1

Changes:

Modularized the code using functions

Cyclomatic Complexity:

alt text

Assumptions/Working:

  1. Input file (org.json) is assumed to be in proper json format (with double quotes for all keys and values) and with the same attributes as shown in the example except for the numbers (enclsosed in "") instead of A,B,C... for emp name.
  2. Input for 2 employee names is taken as 2 space separated strings. Eg: name1 name2.
  3. Output is printed on the terminal only (not in txt file).
  4. Lowest common leader is given as output.
  5. It's assumed that no employee would be his own leader.
  6. It's assumed that levels in the input are ordered and no level is skipped and that an employee has his leader in the immediate preceding level (level-1).
  7. If no common leader exists, then "No common leader" is printed.
  8. I/O format as mentioned in moodle comments:
    Input:
    <emp1> <emp2>
    Output:
    <xyz>
    <xyz> is <number> levels above <emp1>
    <xyz> is <number> levels above <emp2>

Question2

Changes:

Modularized the code using functions

Cyclomatic Complexity:

alt text

Assumptions/Working:

  1. It's assumed that the input file (date_calculator.txt) would be in the same format as given in example (Date1: and Date2: mentioned) and with only 2 dates.
  2. All date inputs are considers to be valid and only in the given formats.
  3. Eg: 10th September, 2020 : there should be space after comma.
  4. Output is printed on the terminal as well as written in the output.txt file.
  5. Output format : "Date Difference: N days".
  6. The program is tested by comparing the results with difference that the datetime library gives.

Question3

Changes:

Modularized the code using functions. Keep employee.txt files in q3_emp folder.

Cyclomatic Complexity:

alt text

Assumptions/Working:

  1. All the .txt files to be given as input should be placed inside q3_emp folder.
  2. It's assumed that all the files would have only one date. If dates vary, then "No slot available" is printed.
  3. It's assumed that the input slots would be in the ascending order (as mentioned in moodle comments).
  4. The slot duration in hours is taken as input from the terminal in decimal format (Eg: 1, 1.5, 2.25)
  5. The output is written in a file (output.txt) as well as printed on the terminal.
  6. Whether there exists a common slot or not, the list of all available slots for each employee is shown.
  7. It was mentioned in moodle that datetime library could be used for this question
  8. If no common slot is found, "No slot available" is shown.

ssd_assignment3's People

Contributors

mansi-k avatar

Watchers

 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.