1answer.
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]
3 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]3 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
What is 82.375 rounded to the nearist whole number
Mashcka [7]
Just 82 because in order for the number to be 83 it would have to be a 5 after the decimal (82.575= 83). Anything lower than a 5 after the decimal (82.375), would be 82. I hope this helps!
6 0
3 years ago
Read 2 more answers
5(x+1)+x=6x+5. Solve, please.
lara31 [8.8K]

Answer:

x = All Real Numbers

Step-by-step explanation:

5x + 5 + x = 6x + 5

Subtract 5 from both sides

5x + x = 6x

Add the x

6x = 6x

x = Any number in the world

Hope that helps!

8 0
3 years ago
Read 2 more answers
PLEASE PLEASE HELP ME<br> Jude graphed the inequality s
Lelechka [254]

Answer:

The graph is correct

Step-by-step explanation:

This is because the graph is representing all values that are less than -9 since the arrow is going to the left from the closed circle -9

4 0
3 years ago
Read 2 more answers
Baseball pitchers on a major league team throw at the following speeds (in miles per hour): 72, 84, 89, 81, 93, 100, 90, 88, 80,
Vinvika [58]

Answer:

100>90+1.5(9)

100>90+13.5

100>103.5

100 is not an outlier

Step-by-step explanation:

72<Q1-1.5(IQR)

72<81-1.5(9)

72<81-13.5

72<67.5

72 is not an outlier

5 0
3 years ago
Will give, Branliest.​
Gwar [14]
Hope it’s right
Best luck with your studying

6 0
3 years ago
Other questions:
  • What is the answer to 1/4N=24
    10·2 answers
  • What is the square root of 55
    12·1 answer
  • What does d/3+10=14 equal?
    8·2 answers
  • Billy throws a ball out of a window at his house on accident. The height of the ball from the ground, h(t), over time, t, can be
    13·1 answer
  • a random sample of 4 claims are selected from a lot of 12 that has 3 nonconforming units. using the hypergeometric distribution
    11·1 answer
  • Is 1/4 greater than 1?
    10·2 answers
  • Question: 13 ÷ 9164
    14·1 answer
  • Factor: m^2 - 20m - 21
    15·1 answer
  • The pie chart shows the colours of 20 cars parked in a local car park.
    12·1 answer
  • How many lines can be drawn through points J and K?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!