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
How many matches are needed to form figure number 9 and 17? explain​
saveliy_v [14]

Answer:

Please find the complete question in the attached file.

Step-by-step explanation:

For point 1:

At this point we make up triangles for the first one makes up by 3 matches figure 2 make up by 5 matches figure 3 makes up by 7 matches.

For point 2:

 4 \ \ 5\ \   6\ \   7\ \   8  you can try to  

9 \ \  11\ \ 13 \ \ 15 \ \ 17 draw to find  values  

For point 3:

number of matches= 1+2 \times \ figure\  number\\\\

For point 4:

1+2 \times 9=19 \ \ (use \ law \ of\  (iii)) \\\\1+2 \times 17=35

3 0
3 years ago
Miguel and Kat are reading the same book. Miguel reads 5 times as many
n200080 [17]

Answer:

k=\dfrac{m}{5}

Step-by-step explanation:

Let Kat reads k pages of the book.

Miguel reads 5 times as many  pages of the book as Kat. So,

m = 5k ...(1)

Together they read 54 pages. i.e.

m+k = 54 ...(2)

From equation (1),

k=\dfrac{m}5{}

Hence, the equation that can be used to find how many pages Kat read is equal to \dfrac{m}{5}.

6 0
2 years ago
Find the inverse of f(x)=-3x+3
kolezko [41]
To get the inverse, first off do a quick switch on the variables, and then solve for "y".

\bf f(x)=y=-3x+3\qquad \qquad inverse\implies \boxed{x}=-3\boxed{y}+3&#10;\\\\\\&#10;x-3=-3y\implies \cfrac{x-3}{-3}=y\implies \cfrac{3-x}{3}=y\impliedby f^{-1}(x)
5 0
3 years ago
Please don’t only answer this explain how to figure it out so I have it for future reference
Deffense [45]
The polygon is built of 7 triangles (picture).

P=7\cdot\dfrac{1}{2}ah\\&#10;a=28.9 \text{ m}\\&#10;h=30 \text{ m}\\\\&#10;P=7\cdot\dfrac{1}{2}\cdot28.9\cdot30\\&#10;P=3034.5 \text { m}^2 \Rightarrow C

5 0
3 years ago
Please help meeee!!!!!!!!!1
andrew11 [14]

D) its hard to keep something a secret, seems like the most accurate answer for this question.

5 0
2 years ago
Read 2 more answers
Other questions:
  • A washer and a dryer cost $942 combined. The washer costs $42 more than the dryer. What is the cost of the dryer?
    8·2 answers
  • Problem In 36 years, Ishaan will be 3 times as old as he is right now.
    13·1 answer
  • Help please
    8·2 answers
  • (will mark brainliest if correct)
    14·1 answer
  • What's the slope- intercept equation? 10x-3y= -6
    13·1 answer
  • Which situation best represents the equation below x-15=60
    8·2 answers
  • Can anyone write this in a notebook for more understanding? Thank you
    7·1 answer
  • Classify the following triangle. Check all that apply.
    10·1 answer
  • Which of the following is the solution to the following system of inequalities? x + 2y 2​
    13·1 answer
  • Simplify x²-4xy+4y²/x²+xy-6y²÷x²+3xy/x²+6xy+9y²​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!