Input: The dividend and divisor are entered by the user on new lines. Output: The quotient will be printed in a new line.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 10PE
icon
Related questions
Question

Write a Java program that returns the result of the division of two numbers that were given by the user. In case of incorrect input, the program must print an error message: “Incorrect input!”.

Input:
The dividend and divisor are entered by the user on new lines.
Output:
The quotient will be printed in a new line.
Example:
>>> Enter a dividend: 63
Enter a divisor: 7
Quotient is : 9
>>> Enter a dividend: 10
Enter a divisor: 5
Quotient is : 2
>>> Enter a dividend: 5
Enter a divisor: 0
Incorrect input!
Transcribed Image Text:Input: The dividend and divisor are entered by the user on new lines. Output: The quotient will be printed in a new line. Example: >>> Enter a dividend: 63 Enter a divisor: 7 Quotient is : 9 >>> Enter a dividend: 10 Enter a divisor: 5 Quotient is : 2 >>> Enter a dividend: 5 Enter a divisor: 0 Incorrect input!
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning