Giter Club home page Giter Club logo

family-tree's Introduction

family-tree

So Basically This is an Command Line Tool Jar for Managing Family Tree (Wanted to Build a native interface though)

System Requirements: JDK-17,JRE17

So yeah I've attached an Jar in this Repository

It supports Commands such as:

  1. add Person [name] : where name is a single word
  2. add relationship [relationshipname] : where relationshipName is a single word
  3. connect [name] as [relationshipname] of [name2]

And Query Commands Such as

  1. count sons of [name]
  2. count wives of [name]
  3. count daughters of [name]
  4. father of [name]

So for example you've to add a person named zeeshan your command would be something like

1)java -jar family-tree-cli.jar add Person zeeshan

2)java -jar family-tree-cli.jar add Person Iftekhar

Similarly for connecting

java -jar family-tree-cli.jar connect ifte as father of zeeshan

for Queries

java -jar family-tree-cli.jar count sons of Iftekhar java -jar family-tree-cli.jar count daughters of Iftekhar java -jar family-tree-cli.jar father of zeeshan

How to use being said I'll Explain the Thought Process behind my design :-

Every Gender is derived through Relations in this program

So Lets say Iftekhar is father of zeeshan

What this specify is that the father is Male , So we dont know what the Child Gender is unless We Connect that Child as son of his . Similarly When we add someone as someone's mother , The Child has a mother which is female but the child gender is unspecified unless we connect that child as son or daughter of that Person

That Being Clear Few Cases That I've considered :-

Lets say PersonA has 2 kids and PersonB has 2 kids So if they marry each other Both of them have 4 kids

If you add personA as father of personB Then count sons or daughter of personA you would get 0 because the gender of child isn't explicit

Apart from this Everything is pretty straight forward

Male can have multiple wives and vice versa (This wasn't clear for me However)

==========================================================================================================================================

Regarding Using only One Object Human

which have following properties:-

String name ;
Human father;
Human mother;
List<Human> SO;
List<Human> kids ;
String gender ;

We can Recursively add relations to this because each Human has the above properties

Here is an image of the operations:- alt text

family-tree's People

Contributors

lazybilla 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.