Write application to allow user to enter a list of integers

Assignment Help JAVA Programming
Reference no: EM131596588

Question.

Write an application to allow user to enter a list of integers, ends the input once the user enter 0. Then ask user to enter a target number, which should be an integer too. Then go through the list of integers, find two integers that sum up to the target number, then return their indexes, where index1 < index2. If no such integer pair can be found, output "There is no two integers sum up to your target number!" (hint, nested for-loop)
Example 1:
Input integers:
1, 2, 3, 5, -9
Target number:
8
Output indexes:
Index1: 3
Index2: 4
Example 2:
Input integers:
1, 6, 3, 5, -9
Target number:
11
Output indexes:
Index1: 2
Index2: 4

Reference no: EM131596588

Questions Cloud

Identify additional areas of concern for organizations : Analyze the characteristics of wireless LANs and assess the security concerns of this technology in organizations such as universities or hospitals.
Discuss the business implications : Research at least two articles on the topic of mobile computing and its business implications. Write a brief synthesis and summary of the two article.
Describe the corporate-level strategies for the corporation : Describe corporate-level strategies for corporation you chose to determine the corporate-level strategy you think is most important to the long-term success.
Calculate the variable costs and fixed costs : During October the activity level was 8,200 units, and the total costs incurred were $68,000. Calculate the variable costs, fixed costs, and mixed costs
Write application to allow user to enter a list of integers : Write an application to allow user to enter a list of integers, ends the input once the user enter 0. Then ask user to enter a target number
What is the divisions profit margin ratio : Assume the Residential Division of Kitridge, Kitridge Faucets had the following results last year: What is the division's profit margin ratio
What is your proposal for addressing identified issues : What is your proposal for addressing identified issues or improvements within your organization? In other words, what changes are you trying to incorporate.
Write an abstract class call animal : Write an abstract class call animal, it should have public int member legNumber, eyeNumber; with an abstract function "public void move()".
Difference between authentication and authorization : Take a tour of your building on campus or at work. What is secured at night when workers are absent? Record the location and type of physical access control.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Write program that play rock-paper-scissors-lizardspock game

Write a program that plays the Rock-Paper-Scissors-Lizard-Spock game. Refer to http://en.wikipedia.org/wiki/Rock-paper-scissors-lizard-Spock for more information.

  Create a java gui application using netbeans

Create a Java GUI application using Netbeans that allows the user to enter the number of hours spent in each activity and then calculates the number of pounds lost.

  Create a virtual world application

Create a Virtual World application as your final project. This Virtual World will have several objects including a MyClone object and another object of your choice.

  Write a recursive method that takes two non-negative integer

Write a recursive method that takes two non-negative integers m and n as parameters and returns the product.

  Integrate ibm watson tool into your software

Integrate IBM Watson tool into your software. Extract both Personality Insights and Tone analyzer form the data set. Initial thoughts on how to represent/model the output for the next stage.

  Controlling and using the paintcomponent ( ) method

How to paint the screen -Controlling and using the paintComponent ( ) method Deliverables app.java, myJFrame.java, myJPanel.java,  and other necessary Java files

  Arguments a minimum value and a maximum value

Write a function that takes as arguments a minimum value and a maximum value and plots sin(x) from the specified minimum to the specified maximum.

  Write a code that tests for a match.

Comments in the code tell you where to write your statements. You can use the Mail Order Program in this chapter guide.

  This applet program needs an html file to run.

This applet program needs an html file to run. You should supply the file along with the program so that the reader can test it.

  Statements to convert the string representation of a student

Write the statements to convert the String representation of a student's test score and class rank to the integer data type.

  How can i support https in a servlet

1) What is SSL? 2) How can I support HTTPS (SSL) in a servlet? 3) How can I download a file (for instance, a Microsoft Word document) from a server using a servlet and an applet?

  Good idea to test a general class with a driver program

Question 1: Why is it a good idea to test a general class with a driver program before trying to use it? Question 2: What is the difference between black box and glass box debugging?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd