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
Which of the following is a polynomial with roots: −square root of 3, square root of 3, and 2? ASAp
jekas [21]
Hello,

P(x)=(x-2)(x²-3)=x^3-2x²-3x+6
==========================
8 0
3 years ago
Please help explanation if possible
Svet_ta [14]

Answer:

18.84 feet.  let me know if you have ay other questions.

Step-by-step explanation:

The way to find the formula for circumference is kinda complicated so it is best to ust memorize the formula, which is 2πr.  or 2 times pi times the radius.  

Your problem gives you the formula, but instead of 2 and r in it you have d, which is the diameter.

The diameter of the circle is 2 times the radius, so that's why it is replaced.

the radius is the distance from the center fo the circle to one edge, and the diameter is the distance through the circle passing through its center.  so it's the center to one end plus the center to another end.  or r+r which is also 2r.

So d = 2r, so in this problem d =6 feet.

So now the formula πd = 3.14*6 feet = 18.84 feet

7 0
3 years ago
Please help w number 2 :) A-B
suter [353]
Peter piper picked a pepper
5 0
3 years ago
Let g(x)=-5x+2 with g(-1)
masha68 [24]
Replace x with -1.

G(-1) = -5(-1) + 2

= 5 + 2

= 7


I hope this Helps!
4 0
3 years ago
*PART D QUESTIONS ONLY*
BlackZzzverrR [31]

Answer:

look at the pictures

Step-by-step explanation:

7 0
2 years ago
Other questions:
  • Find the constant of variation k for the direct variation
    6·1 answer
  • The angles of a triangle are 128 degrees 5x + 10 degrees + 9x degrees what is the value of x
    9·1 answer
  • Find the range of the function f(x) = 4x - 7,
    11·1 answer
  • What is the side length of a cube that has a volume of 729 cubic inches?
    15·2 answers
  • 12 - x = 20 - 5x<br> I don't know how to solve this, please explain
    7·1 answer
  • Help with this pls, I am giving brainliest :D
    15·1 answer
  • Someone answer ASAP please
    10·2 answers
  • 42/15•3/7<br> need help multiplying this
    12·1 answer
  • Someone plss help me
    15·1 answer
  • Pleas help i dont understand
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!