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
1. How many four-digit numbers have a digit sum of 3?
nika2105 [10]

Answer:

10 numbers

Step-by-step explanation:

3 0
3 years ago
Which system of equations cannot be readily solved by the substitution method 6x+12y=11
soldier1979 [14.2K]

Answer:

Step-by-step explanation:

well first off when you work through the promblem you will have to think about the promblem like the variables will cancel out and will have a equation consisting of only contasts.

8 0
3 years ago
HELPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
alisha [4.7K]

Answer: C

Step-by-step explanation:

When you are finding the area, the formula is A= Pi R^2.

The radius is half of the diameter. To get a diameter of 6, you have to multiply 3 by 2.

6 0
3 years ago
Read 2 more answers
Solución para x.*<br> | 12 - x | = 2
wel

Answer:

33

Step-by-step explanation:

6 0
3 years ago
Given the function f(x)=3(x+2)-4 solve for the inverse function when x=2
Mars2501 [29]
The inverse is (x-2)/3 so the answer is f(x)=0
5 0
3 years ago
Other questions:
  • If f(x) = 2X-1 + 3 and g(x) = 5x - 9, what is (f-g)(x)?
    14·1 answer
  • Y=5/4x-2<br>y=5/4x-1<br> !HELP ME GRAPH AND ANSWER THE QUESTION!!
    15·1 answer
  • What was the mistake? *
    8·1 answer
  • Draw a line representing the "run" and a line representing the "rise" of the line. State the slope of the line in simplest form.
    14·1 answer
  • Please answer for branliest
    15·1 answer
  • Match the polynomial with its correct name
    5·1 answer
  • of you would Write a decimal that represents the value of one $1 bill and 5 quarters how would you write that?
    13·1 answer
  • The diagram shows a right-angled triangle.
    9·1 answer
  • Of the flags in Albert's Flag Shop, 1/10 are pink and another 1/2 are orange. What fraction of the flags are either pink or oran
    7·1 answer
  • Are these two claims equivalent, in conflict, or not comparable because they're talking about different things?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!