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
if one angle in a pair of vertical angles measures 36degrees and the other measures (2n-8)degrees, which is the value of n ? ple
KiRa [710]

Answer:

n = 22

Step-by-step explanation:

Since they are vertical angles they are the same.

Therefore you can put together this equation:

2n - 8 = 36

Add 8 to both sides

2n = 44

Divide by 2

n = 22

8 0
4 years ago
Jasmine needs 300cm of fabric to make her new dress. The fabric costs $5 for each METER. How much will her fabric cost to make?​
drek231 [11]

Answer:

$15

Step-by-step explanation:

Step 1:

300cm = 3m

Step 2:

$5 per 1m

Step 3:

$5 × 3

Answer:

$15

Hope This Helps :)

7 0
3 years ago
Find the derivation of the given equation f (x) =7<br>pllz batao??​
Neporo4naja [7]

Answer:

0

Step-by-step explanation:

the derivative is zero since it has no variable

7 0
3 years ago
Read 2 more answers
A used book store buys a hardback book for $1.50 and then sells it for $5. Over time, the store sells the same number of books i
dybincka [34]

A used book store buys a hardback book for $1.50 and then sells it for $5. Over time, the store sells the same number of books it buys. The store manager can use the equation P(x)=5x−1.5x to determine the store's profit, P(x), where x is the number of books that the store sells. Which statement about the book store is true based on the profit equation?

Cost Price of book, C.P.=$1.50

Selling Price of book, S.P.=$5

PROFIT=S.P. -C.P.

So, Profit=$5-$1.50=$3.50

So, Profit=$3.50 on each book

Or, we are given P(x)= 5x-1.50x

Or, P(x)=3.50x

For each book, we must divide the profit P(x) by x, that is, number of books

\frac{P(x)}{x}=\frac{3.5x}{x}

\frac{P(x)}{x}=\frac{3.5*1}{1}

\frac{P(x)}{x}=3.5

So, Profit for each book sold is $3.50

Answer:Option C

8 0
3 years ago
Tim had $150 to spend on 3 pairs of pants. After buying
Aneli [31]

Answer:D

Step-by-step explanation: 3 represents the pants, x is the price of the pants, and the 30 is the remaining money. All this combined =150.

5 0
3 years ago
Other questions:
  • Marcus has created a budget for his upcoming trip to the theme park. Admission is 40% of the budget. He plans to spend 32% of hi
    15·1 answer
  • A deli sells a sandwich bread for $6.40 per pound . Much do you have to pay for 24 ounces of the spread?
    6·2 answers
  • 5) x-y+6; use x = 6, and y = 1
    15·1 answer
  • Consider a manufacturing company. They produce thousands of widgets with a defective rate of 0.11. If a sample of 3 widgets is d
    5·1 answer
  • Can someone help me with those three and explain how u got it
    5·1 answer
  • HELP ASAP
    14·1 answer
  • Can someone help with this question? I’m stuck.
    15·1 answer
  • Given f(x) = 4x+ 7 and g(x) = -3x+ 5 find g (f(-5).<br> 20<br> 44<br> -1<br> 87
    9·1 answer
  • M and n are parallel lines cut by a transversal.<br> What is the value of x + y?
    9·1 answer
  • F + 2.5= 3f + 7.24 (What first step would you do to solve for f? )
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!