Skip to content

Instantly share code, notes, and snippets.

@vin-droid
Created April 24, 2020 19:14
Show Gist options
  • Save vin-droid/2c692855ee6cf62c278a0f7949a10139 to your computer and use it in GitHub Desktop.
Save vin-droid/2c692855ee6cf62c278a0f7949a10139 to your computer and use it in GitHub Desktop.

Jimmy is foodie and he visits Pune. He has X rupees with him. There are n number of hotels with different menu. Jimmy has list of all hotels with their menu and price with him.

Now instead of searching manually he wants to design a system to will give him a list of hotels that are under his budget.

Help Jimmy in writing the program.

Restaurant List:

  1. Box8
  • Rajma 30
  • Vada Pav 50
  • Dal 20
  1. Locavore
  • Dal 10
  • Vada Pav 30
  • Sabji 40
  1. Flavours
  • Ice cream 10
  • Sandwich 20
  • Burger 30
  • Vada Pav 30

Input: dish_name(string), balance_amount(integer)

Output: A list of name of restaurants having the given dish under the given price

ex:

  • input: Vada Pav, 30
  • output: [ Locavore, Flavours ]
  1. Write a program in which teachers need to distribute certificates and prizes of exams. Thing is student can collect certificates of their friends but cant collect prizes. Teacher also need to keep count of certificates and prizes distributed, which can also be seen by Principal. Parents of student can check marks but cant collect certificate or prizes?

Program should answer following question

  1. Number of certificate and prize distributed

  2. Number of student attended exams

  3. Principal can see distributed certificate/prize but cant modify it

  4. Certificate and Prize collection of students

  5. In Dvapara Yuga, Guruji had special powers to bless their shishay(students). If guruji used to like any shishay then he used to give them powers to fly, swim, run fast through their aashirwad. If they were unhappy from shishay then they use to take those special gift back by giving shraap.

Write a program such that Ex:

guru = Guru.new(....)
guru.ashirwad(arjun, 'fly')```

then

```arjun.fly```
 returns 'I am flying. I will defeat kaurav'

```guru.shraap(arjun, 'fly')```

```arjun.fly```
 returns 'I can't fly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment