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
Mya is paid $960 a week to walk 20 dogs. If she is paid the same amount to walk each dog , what is the cost to walk one dog each
Sveta_85 [38]
We know that

<span>Mya is paid $960 a week to walk 20 dogs
then
</span>$960/20 dogs-----> $48 for one dog each week

the answer is
the cost to walk one dog each week is $48
7 0
3 years ago
Have to find volume and surface area but idk how
Setler [38]

Answer:

volume 1050 in^{3}

surface area 859 in^{2}

Step-by-step explanation:

volume is length times width times height (7*25*12)/2

surface area is area of all the sides added together

2(25*12)+(12*7)+ 2(\frac{7*25}{2})

4 0
3 years ago
Read 2 more answers
To convert 25 minutes to hours, you would use the ratio 1hour/60minutes?
Talja [164]
Idk but it's 0.416667

cuz 25/60 equals so
7 0
3 years ago
I need help please!!!
ludmilkaskok [199]

Answer:

x ≥ -1

Step-by-step explanation:

the red fully circle in -1 show that -1 is include

8 0
3 years ago
Read 2 more answers
Solve for each unknown
ehidna [41]
<span>6=2+u then u = 6 - 2 = 4
(-16)=(-9)-w then w = 16 - 9 = 7
8=r+4 then r = 8 - 4 = 4
v+(-3)=(-10) then v = -10 + 3 = -7
9=j+7 then j = 9-7 = 2
(-14)=r-6 then r = -14 +6 = -8
(-2)-k=4 then k = -2 -4 = -6
(-10)=n-8 then n = -10 + 8 = -2
(-9)=s+(-4) then s = -9 + 4 = -5
(-4)-s=0 then s = -4</span>
5 0
3 years ago
Other questions:
  • I will mark brainliest please help me​
    14·1 answer
  • Rotation: 270° about the origin<br> Reflection: across the x-axis
    6·1 answer
  • A manufacturer has fixed costs of $16,000 per month and can produce w widgets at a cost of 0.1w^(2) + 20w. How many widgets shou
    6·1 answer
  • Which of the following ordered pairs represents a solution to the linear inequality y &lt; 6x – 4?
    9·1 answer
  • 34.67×650 this answer
    5·2 answers
  • Please help solve quickly
    15·2 answers
  • Translate each sentence into an equation 5 more than 3/4 a number is -18
    15·1 answer
  • Srurface area 1m 2m 1m
    7·2 answers
  • Estimate the closest whole number to the square root of 85.
    12·1 answer
  • Trying to see what my answer would be
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!