Coder Social home page Coder Social logo

katas.code.anonymouspoll's Introduction

Anonymous Poll

Your university wants you to fill out an “anonymous” survey. There are many questions but some fields are mandatory:

  • Gender
  • Age
  • Education
  • Academic Year

Are you sure this is really anonymous? If you have a list of all students and you ask them to take a random survey, you may be able to identify the students who complete the survey.

The list of students is a text file. Each line has the information of a student in comma-separated values:

name1,gender1,age1,studies1,academic_year1
name2,gender2,age2,studies2,academic_year2
...

The gender can be “M” (male) or “F” (female).

Input

Input starts with a number “T” (T <= 100) followed by “T” cases. Each case is a list of comma-separated values, which are:

gender,age,studies,academic_year

Output

For each case, you must print the list of students that match the input. If there are multiple results, print them in lexicographical order and separated by commas. If there are not matches, print “NONE”.

Use the following format:

Case #Ti: Ri

Where “Ti” is the case number and “Ri” is the result.

Implementation

  • Implements the solution "Anonymous Poll" using Object-Oriented Programming and SOLID principles finding the best solution to create a maintainable software.

Sample input

5
M,21,Human Resources Management,3
F,20,Systems Engineering,2
M,20,Manufacturing Engineering,3
M,18,Electrical Engineering,4
F,25,Construction Engineering,4

Sample output

Case #1: NONE
Case #2: Morgan Martinez Moore
Case #3: Alfie Hernandez Diaz
Case #4: Mohammad Green Morales,Oliver Carter Rivera
Case #5: Ellie Brown Reed,Laura Stewart Foster,Nicole Peterson Torres

¿How to deliver the solution?

katas.code.anonymouspoll's People

Contributors

xavi-belloso avatar

Stargazers

Jordi avatar

Watchers

James Cloos avatar Ramon Balaguer Altadill avatar Eduardo Briz 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.