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
Harley has 5 quarts of orange juice to fill some empty glasses. She fills each glass with 14
jonny [76]

Answer:

This question does not make sense

Step-by-step explanation:

4 0
3 years ago
Complete the remainder of the table for the given function rule:
USPshnik [31]

answer is

(Y)=-23,-14, -5,4,13

hope this will help you

3 0
2 years ago
If total employee benefits are calculated as a percentage of their gross pay, which of the following employees receives the larg
vlabodo [156]

Consider all employees.

A.

  • gross pay $32,600 - 100%,
  • total job benefits $33,600 - x%.

Then

\dfrac{32,600}{33,600}=\dfrac{100}{x},\\ \\32,600\cdot x=33,600\cdot 100,\\ \\x=\dfrac{33,600\cdot 100}{32,600}=\dfrac{33,600}{326} \approx 103.07.

Employee A receives 3.07% of gross pay in employee benefits.

B.

  • gross pay $32,900 - 100%,
  • total job benefits $34,000 - x%.

Then

\dfrac{32,900}{34,000}=\dfrac{100}{x},\\ \\32,900\cdot x=34,000\cdot 100,\\ \\x=\dfrac{34,000\cdot 100}{32,900}=\dfrac{34,000}{329} \approx 103.34.

Employee B receives 3.34% of gross pay in employee benefits.

C.

  • gross pay $33,400 - 100%,
  • total job benefits $33,900 - x%.

Then

\dfrac{33,400}{33,900}=\dfrac{100}{x},\\ \\33,400\cdot x=33,900\cdot 100,\\ \\x=\dfrac{33,900\cdot 100}{33,400}=\dfrac{33,900}{334} \approx 101.50.

Employee C receives 1.50% of gross pay in employee benefits.

D.

  • gross pay $33,700 - 100%,
  • total job benefits $34,700 - x%.

Then

\dfrac{33,700}{34,700}=\dfrac{100}{x},\\ \\33,700\cdot x=34,700\cdot 100,\\ \\x=\dfrac{34,700\cdot 100}{33,700}=\dfrac{34,700}{337} \approx 102.97.

Employee D receives 2.97% of gross pay in employee benefits.

Answer: correct choice is B.

7 0
3 years ago
Read 2 more answers
I have to find the area of the shape
Alekssandra [29.7K]
The answer is 18m^2. if u find the area of each section and add it up together at the end then u get 18

5 0
3 years ago
Please help!!<br> (5 points AND BRAINLEST)
Debora [2.8K]
So for you’r question its definitely B
4 0
2 years ago
Read 2 more answers
Other questions:
  • Brian is 1 meter 87 centimeters tall. Bonnie is 58 centimeters shorter than Brian. Betina is 26 centimeters taller than Bonnie.
    10·2 answers
  • 6. Which ordered pairs are solutions to the inequality 5 − ≤20 Select each correct answer
    6·2 answers
  • The cherries and grapes are in bags of 10. Ben gives Emma some of the bags. What math questions could Ben ask about the bags of
    8·1 answer
  • The graph of a rational function, f, is shown in the figure. Use the graph to find f(-2)
    7·1 answer
  • Solve the following systems of 3-variable linear equations.​<br><br><br><br>50 points
    7·1 answer
  • How you could use a number line to determine which of two numbers is greater
    10·1 answer
  • The zeros of a function P(x)=x2-2x-24
    12·1 answer
  • Please help!!!!!!!!!!!!!!!!!!!!
    13·2 answers
  • Helppppppppppppppppppp
    9·1 answer
  • Caritas 37 coins on nickels and dimes in his piggy bank the value of the coins is $3.10 write a system of equations define the v
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!