Write a Java program that takes a positive number up to 100 as a dividend and...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a Java program that takes a positive number up to 100 as a dividend and a positive number up to 10 as a divisor. All numbers from the dividend down to the divisor are then divided by the divisor. Only results without remainder are printed out. The program should continue until user enters 999 as input. An appropriate error message should be displayed if any negative number is entered as input. Example Runs Run1 Dividend (0-100, 999 to exit)? 35 Divisor? 7 35/7=5 28/7 = 4 21/7=3 14/7 = 2 7/7=1 Dividend (0-100, 999 to exit)? -4 Invalid input! Dividend (0-100, 999 to exit)? 45 Divisor? -7 Invalid input! Dividend (0-100, 999 to exit)? 999 Bye bye! Write a Java program that takes a positive number up to 100 as a dividend and a positive number up to 10 as a divisor. All numbers from the dividend down to the divisor are then divided by the divisor. Only results without remainder are printed out. The program should continue until user enters 999 as input. An appropriate error message should be displayed if any negative number is entered as input. Example Runs Run1 Dividend (0-100, 999 to exit)? 35 Divisor? 7 35/7=5 28/7 = 4 21/7=3 14/7 = 2 7/7=1 Dividend (0-100, 999 to exit)? -4 Invalid input! Dividend (0-100, 999 to exit)? 45 Divisor? -7 Invalid input! Dividend (0-100, 999 to exit)? 999 Bye bye!
Expert Answer:
Answer rating: 100% (QA)
Here is a Java program that meets the requirements import javautilScanner public class DivisorFinder ... View the full answer
Related Book For
Java An Introduction To Problem Solving And Programming
ISBN: 9780134462035
8th Edition
Authors: Walter Savitch
Posted Date:
Students also viewed these programming questions
-
Let A, B be sets. Define: (a) the Cartesian product (A B) (b) the set of relations R between A and B (c) the identity relation A on the set A [3 marks] Suppose S, T are relations between A and B, and...
-
Predictive text entry systems are familiar on touch screens and mobile phones. This question asks you to consider how the same principles might be used in a programming editor for creating Java code....
-
Holly funded the Holly Marx Trust in January 2020. The entire trust income is payable to her adult son Jack for 20 years. At the end of the twentieth year, the trust assets are to pass to Hollys...
-
The age of an account receivable is the length of time that it has been outstanding. At the end of October, a firm has $12,570 in receivables that are 30 days old, $6850 in receivables that are 60...
-
The following balances are from the accounts of Tappan Parts: Direct materials used during the year amount to $1,196,000 and the cost of goods sold for the year was $1,378,000. Required Find the...
-
Why cant traditional bits perform similar operations?
-
The Nevens Company uses a periodic inventory system. During November the following transactions occurred: Required Compute the cost of goods sold for November and the inventory at the end of November...
-
Your company has an on-premises Active Directory domain and a new Microsoft 365 E5 subscription. You plan to sync on-premises Active Directory objects to Microsoft Entra. You need to identify which...
-
(a). By the end of this year you would be 35 years old and you want to plan for your retirement. You wish to retire at the age of 65 and you expect to live 20 years (I hope more) after retirement....
-
The following information was taken from the books and records of Crane, Inc.: 1 . Net Income $ 4 9 7 , 2 0 0 2 . Capital structure: a . Convertible 6 % bonds. Each of the 3 4 0 , $ 1 , 0 0 0 bonds...
-
Petz, an Irish pet food and accessories retailer, is considering expanding into the UK. The initial expansion would be into a Birmingham, a mid-sized city in the UK. Due to the high set-up costs and...
-
An asset was purchased for $ 1 1 0 , 0 0 0 on January 1 , Year 1 , and originally estimated to have a useful life of 9 years with a residual value of $ 8 , 0 0 0 . At the beginning of the third year,...
-
Blossom Corporation has outstanding 2 , 0 0 0 of $ 1 , 0 0 0 bonds, each convertible into 7 0 shares of $ 1 0 par value common stock. The bonds are converted on December 3 1 , 2 0 2 5 , when the...
-
What type of Indexes are the S&P 500, Dow Jones Industrial Average, and NASDAQ Composite? What factors influence the performance of these indexes? Is there a difference between the performances of...
-
Compare and evaluate risk management techniques from experts in the field. Go to the Ashford university library and find one article by dr. James Kallman. Dr. Kallman, an expert in the field of risk...
-
What exactly is a prima facie duty? How does an ethic of prima facie duties differ from monistic and absolutist ethical theories?
-
For installation and operation of a pipeline for an incompressible fluid, the total cost (in dollars per year) can be represented as follows: \[C=C_{1} D^{1.5} L+C_{2} m \Delta p / ho\] where...
-
Heavy fuel oil, initially semisolid at $15^{\circ} \mathrm{C}$ is to be heated and pumped through a $15 \mathrm{~cm}$ diameter (inside) pipe at the rate of $20000 \mathrm{~kg} / \mathrm{h}$. The pipe...
-
We are interested to produce $P$ in the reaction $A ightarrow P$ using a continuous reactor at $v=240$ liters/ hr with $C_{A_{0}}=3$ moles/liter. However, it is noticed that there is a second...
Study smarter with the SolutionInn App