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 question is a statistics question that anticipates variability? A) What is my brother's favorite type of car to drive? Eli
rewona [7]
It think that it would be D) or C).
Plz tell me if it is right or wrong it the comments below.
4 0
3 years ago
Read 2 more answers
The expression m divided by 4 is teh distance each person runs in a relay race that is m miles. How far does each person run in
Dovator [93]

Answer:

Each person runs 3 miles in a relay race.

Step-by-step explanation:

Given:

Distance of Relay race m = 12 miles.

The expression m divided by 4 is the  distance each person runs in a relay race that is m miles.

Each person runs in relay race = \frac{m}{4}

Now given the total distance of the relay race is 12 miles.

i.e. value of m = 12 miles

Now substituting the value of m in above equation we get;

Each person runs in relay race = \frac{m}{4} = \frac{12}{4}=3 \ miles

Hence each person runs 3 miles in a relay race.

6 0
3 years ago
Find the measure of AB? using law of sines.
choli [55]
The Law of Sines states that
\frac{ac}{ \sin(b) }  =  \frac{ab}{ \sin(c) }
Therefore,
\frac{15}{ \sin(44) }  =  \frac{ab}{ \sin(53) }
Multiply both sides by sin(53):
ab = \frac{ \sin(53) \times 15 }{ \sin(44) }
AB = 17.25
The answer is D) 17
3 0
3 years ago
The Transitive Property of Congruence states that if ∠XYZ ≅ ∠​AOB and ∠​AOB ≅ ∠​WYT, then _____.
solniwko [45]
In other terms, the Transitive Property states that if ∠a = ∠b and ∠b = ∠c, then ∠a = ∠c. So, if ∠XYZ = ∠AOB and ∠AOB = ∠WYT, then ∠XYZ = ∠WYT. The correct answer here would be B. 
4 0
3 years ago
Write a word problem that you can solve using multiples to estimate the quoitent
OleMash [197]
Sally went to the book store, in this book store all books are only $9.00 . sally said that she only needs 7 books. the answer is 9 times7 which is 63.
7 0
4 years ago
Other questions:
  • For any set B, the null set, ∅, is a proper subset of B TRUE OR FALSE
    6·1 answer
  • How many unique triangles can be drawn with given side lengths of 8 inches,10.3 inches,and 13 inches?​
    9·1 answer
  • 1. A 15-,,oz bag of yum yum tortillas chips contains 5 servings. there are 240 milligrams of salt in each servings. how many mil
    10·1 answer
  • Between midnight and 6:00 A.M., the temperature dropped 10 degrees. Between 6:00 AM and noon, the temperature rose 18 degrees. W
    13·1 answer
  • What is the value of the expression? 200 - 42 + 9 · 10
    12·2 answers
  • Which set or sets does 0.25 belong in
    5·1 answer
  • Find percent of each number <br> 1) 5% of 40<br> 2) 250% of 44<br> 3) 0.5% of 13.5<br> 4) 32% of 54
    13·1 answer
  • What is the similarity ratio of a cube with volume 216 m³ to a cube with volume 2744 m³
    12·1 answer
  • I don’t like math. Please help
    12·2 answers
  • Available options for marble color are red, blue, and green. How many green marbles should there be so that the probability of s
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!