answer.
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]
1 year 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]1 year 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
The sum of two positive integers, x and y, is not more than 40. The difference of the two integers is at least 20. Chaneece choo
oksian1 [2.3K]
<span>Chaneece chooses x as the larger number and uses the inequalities y ≤ 40 – x and y ≤ x – 20 to determine the possible solutions.

</span>y ≤ 40 – x, if x must be between 0 and 10, y must be between 20 and 40 <span>it is true
proof
</span><span>for x=0  and y=10,  y ≤ 40 – x equivalent to 10<40-0=40 it is true
</span>x=10, y=30,   <span>y ≤ 40 – x  equivalent to 30=40-10=30 it is true

the answer is </span><span>A) Yes, Chaneece found the correct solution. </span>
5 0
2 years ago
Read 2 more answers
.
crimeas [40]

Answer:

coffee is the best answer in my mind

4 0
2 years ago
A professor, transferred from Toronto to New York, needs to sell his house in Toronto quickly. Someone has offered to buy his ho
I am Lyosha [343]

Answer:

(a) = 40%

(b) = 28%

(c) Expected value = $222,500

Standard deviation = $7,216.88

Step-by-step explanation:

This is a normal distribution with a = 210,000 and b =235,000

(a) The probability that he will get at least $225,000 for the house is:

P(X\geq 225,000) =1 -\frac{225,000-a}{b-a} =1-\frac{225,000-210,000}{235,000-210,000} \\P(X\geq 225,000) =0.4= 40\%

(b)The probability he will get less than $217,000 is:

P(X\leq 217,000) =\frac{217,000-a}{b-a} =\frac{217,000-210,000}{235,000-210,000} \\P(X\leq 217,000) =0.28= 28\%

(c) The expected value (E) and the standard deviation (S) are:

E=\frac{a+b}{2}=\frac{210,000+235,000}{2}\\ E=\$222,500\\S=\frac{b-a}{\sqrt{12}}=\frac{235,000-210,000}{\sqrt{12}}\\S=\$7,216.88

4 0
2 years ago
A school employs 30 teachers.how many will there be if there is a 10% reduction
Georgia [21]
Whats the question bro?    
8 0
2 years ago
What is the lateral area of a cylinder which has an element of 8 inches and a right section with a perimeter of 24 inches?
Greeley [361]
3 is the answer because 24/3=8
7 0
1 year ago
Other questions:
  • Dylan has two cubes of iron. The larger cube has twice the mass of the smaller cube. He measures the smaller cube. It's mass is
    6·1 answer
  • At a convention of monsters, 2/5 have no horns, 1/7 have one horn, 1/3 have two horns, and the remaining 26 have three or more h
    5·1 answer
  • What values of b satisfy 4(3b + 2)2 = 64?
    15·2 answers
  • What is the value of x in the equation 1.5(x + 4) – 3 = 4.5(x – 2)? 3 4 5 9
    11·2 answers
  • All angles in the diagram are measured to the nearest degree.
    6·1 answer
  • Please help!!
    14·1 answer
  • Using V = lwh, what is an expression for the volume of the following prism? The dimensions of a prism are shown.
    7·2 answers
  • Gideon insured his tapes restaurant with a fire insurance policy of $90,000 at a cost of $0.58 per $100. Eight months later his
    10·1 answer
  • In some languages, every consonant must be followed by a vowel. How many seven-letter ‟words” can be made from the Hawaiian word
    7·1 answer
  • -&gt; What is the remainder of 46 divided by 48?
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!