GfG QA is closing soon... Please refer PRACTICE or GfG now on wards !!

item search in text file with java

Alaxendar, a very smart guy, likes eating food. Now, Alaxendar is at a restaurant and he has many different types of food to choose from. Alaxendar gets x amount of satisfaction and requires y amount of time to eat an item from the menu. Given t minutes, write a java program that reads the text file and finds out the maximum satisfaction that Alaxendar can get from eating at the restaurant. You will be given a text file with the following format: [t][Number of items on menu] [amount of satisfaction from eating dish 1][time taken for dish 1] [amount of satisfaction from dish 2][time taken for dish 2]

asked Dec 3, 2016 by kamal_svpi 1 flag