Java Programming and Technical Programming Program

Question: Write a program to find all the combinations between 1 and 1000 in which
1. doubling the first number and substracting from the second number will give a result of zero.
2. if the result is not 0, double the result and use it as the first number and repeat step 1.

Read Solution (Total 25)

Java Other Question

Because it is the Internet Age, but also it is a recession, the Comptroller of the town of Jurgensville has decided to publish the prices of every item on every menu of every restaurant in town, all in a single CSV file (Jurgensville is not quite up to date with modern data serialization methods).

The file's format is:

for lines that define a price for a single item:
restaurant ID, price, item_label

All restaurant IDs are integers, all item labels are underscore(no space) separated letters, and the price is a decimal number.

Because you are an expert software engineer, you decide to write a program that accepts the town's price file, and a list of item labels that someone wants to eat for dinner, and outputs the restaurant they should go to, and the total price it will cost them.
Note: Total price should be minimum price among all restaurants in the town.

If multiple restaurants are found, output any restaurant ID with the minimum price.

Please solve the puzzle above using the development language that you are being interviewed for.
We have seen many solutions that work for the attached data-set.

Here are some sample data sets, program inputs, and the expected result:
----------------------------
Data File data.csv
1, 4.00, burger
1, 8.00, tofu_log
2, 5.00, burger
2, 6.50, tofu_log
Program Input:
program data.csv burger tofu_log
Expected Output:
2, 11.5

----------------------------
----------------------------
Data File data.csv
3, 4.00, chef_salad
3, 8.00, steak_salad_sandwich
4, 5.00, steak_salad_sandwich
4, 2.50, wine_spritzer
Program Input
program data.csv chef_salad wine_spritzer
Expected Output:
Nil (to indicate that no matching restaurant could be found)

----------------------------
----------------------------
Data File data.csv
5, 4.00, extreme_fajita
5, 8.00, fancy_european_water
6, 5.00, fancy_european_water
6, 6.00, extreme_fajita
Program Input:
program data.csv fancy_european_water extreme_fajita
Expected Output:
6, 11.0
----------------------------
We have included all these samples in the attached file, sample_data.csv.
875432103654