answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
WITCHER [35]
2 years ago
9

Write a program that prompts the user to read two integers and displays their sum . if anything but an integer is passed as inpu

t, your program should catch the inputmismatchexception that is thrown and prompt the user to input another number by printing "please enter an integer ."
Mathematics
1 answer:
natka813 [3]2 years ago
4 0
<span>The Java code below will ask for two integers and display the sum. If a non-integer is submitted the code will ask again. The break is used to exit the while true loop indicating that no-errors had occurred and two numbers were added. System.out.print("Please insert two integers and this will display the sum."); int numOne; int numTwo; while (True) { try{ System.out.print("Integer Number One? "); numOne = input.nextInt(); System.out.print("Integer Number Two? "); numTwo = input.nextInt(); System.out.print("The Sum Is: " + (numOne + numTwo)); break; } catch (InputMismatchException e) { System.out.print("please enter an integer ."); } }</span>
You might be interested in
(4 tens 3 ones) x 10
adoni [48]

To solve this problem, we must first convert all of the numbers represented by words into their numeral equivalents so we can simplify. To do this, we must remember that the ones place is the first to the left of the decimal point, and the tens place is one place farther to the left. If we have 4 tens and 3 ones, this is the same as 43 (we put the digit 4 in the tens place and the digit 3 in the ones place). If we replace our words with our new numerical value, we get:

43 * 10

To solve this, we just multiply these two numbers together, which gives us:

430

Therefore, your answer is 430.

Hope this helps!

6 0
2 years ago
Triangle A B C is shown. Angle A C B is a right angle. The length of hypotenuse A B is 12 centimeters, the length of C B is 9.8
Dafna11 [192]

Step-by-step explanation:

yo digo que es eso la verdad no se

3 0
2 years ago
Read 2 more answers
Les is measuring the border of her bulletin board. She measures around the entire outside of the bulletin board and finds the di
vagabundo [1.1K]

Answer:

Perimeter.

Step-by-step explanation:

Lee measures around the entire outside of the bulletin board and finds the distance is 32 units.

She is measuring the border of her bulletin board.

The sum of outer covering of any object is called its perimeter. Here, 32 unit shows the perimeter of the bulletin board.

7 0
2 years ago
Jackie is selling smoothies at a school fair. She starts the day with $15 in her cash box to provide change to her customers. If
saul85 [17]

The answer is 4 if you divide it


8 0
2 years ago
Read 2 more answers
Jane likes to exercise daily. The table shows the number of calories y she burns by exercising steadily for x minutes. How many
Nataly_w [17]
Do you have a picture of the table?
8 0
2 years ago
Read 2 more answers
Other questions:
  • Using the side-splitter theorem, which segment length would complete the proportion?
    5·2 answers
  • What is the solution set of (x - 2)(x - 3) = 2? {1, 4} {2, 3} {4, 5}
    10·2 answers
  • ​sixty-two percent of pet owners say they consider their pet to be their best friend. you randomly select 12 pet owners and ask
    5·1 answer
  • bookstore ordered 1,528 packs of pens and 1,823 packs of pencils at the prices shown. how much did the bookstore spend on pens?
    5·1 answer
  • What is 0.8333 forever in a fraction
    8·2 answers
  • You are converting 8 centimeters to meters. How will the number of meters compare to 8? Explain.
    5·2 answers
  • Data on the oxide thickness of semiconductor wafers are as follows: 425, 431, 416, 419, 421, 436, 418, 410, 431, 433, 423, 426,
    8·1 answer
  • A plane ticket barcelona costs £175 the price decreases by 6% work out the new price
    12·2 answers
  • The expression 4\cdot3^t4⋅3 t 4, dot, 3, start superscript, t, end superscript gives the number of ducks living in Anoop's pond
    8·2 answers
  • 1. Between finishing their dinner and going to bed, Zac and Lucy had 4 hours.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!