Giter Site home page Giter Site logo

mainactivitykt / simple-search-engine-kotlin Goto Github PK

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

A project of Kotlin Developer track on Hyperskill.

Home Page: https://hyperskill.org/projects/89

Kotlin 100.00%
simple-search-engine-kotlin hyperskill hyperskill-kotlin jetbrains-academy

simple-search-engine-kotlin's Introduction

Simple Search Engine (Kotlin)

Simple Search Engine is one of the projects in Kotlin Developer track on Hyperskill.

Open poroject at Hyperskill

As the name sounds, it is a basic search-engine program that uses terminal to work with given data, search for specific keywords and apply different searching strategies.

Stage 1/6:

A very basic searching engine! Takes a list of space-separated string as the first input, and a string as the next input. It returns the position of that string in the list if it is present.

Run either main.kt with the input 1 or, Stage1.kt file

input

roses daises dahlias
daises

output

2

input

Germany Russia Czechia Netherlands 
SaintPetersburg

output

Not found

Stage 2/6:

In this stage, the program reads text lines from the standard input and processes single-word queries. The program outputs all lines that contain the string from the query.

Run main.kt and input 2, or Stage2.kt.

Example

Enter the number of people:
> 6
Enter all people:
> Dwight Joseph [email protected]
> Rene Webb [email protected]
> Katie Jacobs
> Erick Harrington [email protected]
> Myrtle Medina
> Erick Burgess

Enter the number of search queries:
> 3

Enter data to search people:
> ERICK

People found:
Erick Harrington [email protected]
Erick Burgess

Enter data to search people:
> unknown
No matching people found.

Enter data to search people:
> [email protected]

People found:
Rene Webb [email protected]

Stage 3/6:

This stage includes extending the previous stage by adding a user menu for a better experience

Run main.kt and input 3, or Stage3.kt.

Example

Enter the number of people:
> 6
Enter all people:
> Dwight Joseph [email protected]
> Rene Webb [email protected]
> Katie Jacobs
> Erick Harrington [email protected]
> Myrtle Medina
> Erick Burgess

=== Menu ===
1. Find a person
   2. Print all people
   0. Exit
> 3

Incorrect option! Try again.

=== Menu ===
1. Find a person
   2. Print all people
   0. Exit
> 1

Enter a name or email to search all suitable people.
> KATIE
Katie Jacobs

=== Menu ===
1. Find a person
   2. Print all people
   0. Exit
> 2

=== List of people ===
Dwight Joseph [email protected]
Rene Webb [email protected]
Katie Jacobs
Erick Harrington [email protected]
Myrtle Medina
Erick Burgess

=== Menu ===
1. Find a person
   2. Print all people
   0. Exit
> 0

Bye!

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.