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)
-
- public class ZeroNumbersComb {
public static void main(String[] args) {
for(int firstNum =1; firstNum - 9 years agoHelpfull: Yes(5) No(0)
- public class ZeroNumbersComb {public static void main(String[] args) {for(int firstNum =1; firstNum
- 9 years agoHelpfull: Yes(2) No(0)
- SRIKAR, It's not getting all the line , given ur mail id i'll send it
- 9 years agoHelpfull: Yes(2) No(0)
- please send this answer to my mail-id gowthamisripuram333@gmail.com
- 6 years agoHelpfull: Yes(1) No(0)
- public class ZeroNumbersComb {
public static void main(String[] args) {
for(int firstNum =1; firstNum - 9 years agoHelpfull: Yes(0) No(0)
- i can see only the first
3 lines - 9 years agoHelpfull: Yes(0) No(0)
- i can see only the first
3 lines - 9 years agoHelpfull: Yes(0) No(0)
- forward the to my mail id also
pnvssrajkumar@gmail..com
thanks in advance - 9 years agoHelpfull: Yes(0) No(0)
- Program send to my mail id plz:bhaskar9446@gmail.com
- 9 years agoHelpfull: Yes(0) No(0)
- send it to my mail id please,,,,,,,,, my mail id: gopikrishna687@gmail.com
- 9 years agoHelpfull: Yes(0) No(0)
- please send it to me also my id is
anoopshrivastava@live.com
Thankss - 9 years agoHelpfull: Yes(0) No(0)
- send it to my mail id please,,,,,,,,, my mail id: sandhyaa408@gmail.com
- 9 years agoHelpfull: Yes(0) No(0)
- pls mail me too... suman.kr02@gmail.com
- 9 years agoHelpfull: Yes(0) No(0)
- aaaaaaaaaa
- 9 years agoHelpfull: Yes(0) No(1)
- pls send program to my mail id:sanjanamahi90@gmail.com
- 9 years agoHelpfull: Yes(0) No(0)
- Plz send this program to my arunkumar280293@gmail.com
- 9 years agoHelpfull: Yes(0) No(0)
- SEND THIS PROGRAM TO thegangadar@gmail.com
- 9 years agoHelpfull: Yes(0) No(0)
- please send me the solution to shivakrishna5815@gmail.com
- 9 years agoHelpfull: Yes(0) No(0)
- please snd me program-deepikaadwani924@gmail.com
- 9 years agoHelpfull: Yes(0) No(0)
- plz send to my mail id sirigirinare@gmail.com
- 9 years agoHelpfull: Yes(0) No(0)
- Mail me this sivaprakashkumarjsp@gmail.com
- 9 years agoHelpfull: Yes(0) No(0)
- please mail it to praveenattigeri@gmail.com
- 9 years agoHelpfull: Yes(0) No(0)
- pleaase send to my mail id :pasamchaitanya@gmail.com
- 8 years agoHelpfull: Yes(0) No(0)
- plz send me the answer on my id stunningrajnibala@gmail.com
- 7 years agoHelpfull: Yes(0) No(0)
- please provide the code for this question and send to this email id :shiva.venkata9@gmail.com
- 6 years agoHelpfull: Yes(0) No(0)
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