Write an application that prompts for and reads the numerator and denominator of a fraction as integers, then displays the decimal equivalent of the fraction. Hint: This requires casting from integer to double before dividing. Testing: Submit testing exhibits using the following inputs: 0,1 giving 0.0; 1, 2 giving 0.5; 3, 8 giving 0.375; 2, 3 giving 0.666...; 25, 7 giving 3.57128...

Systems Architecture
7th Edition
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Stephen D. Burd
Chapter10: Application Development
Section: Chapter Questions
Problem 5VE
icon
Related questions
Question

Must be in JAVA. Please show in simplest form and with comments. 

Data and Expressions
Transcribed Image Text:Data and Expressions
3. Write an application that prompts for and reads the numerator and denominator of a fraction as integers, then displays the decimal
equivalent of the fraction.
Hint: This requires casting from integer to double before dividing.
Testing: Submit testing exhibits using the following inputs:
0,1 giving 0.0; 1, 2 giving 0.5; 3, 8 giving 0.375; 2, 3 giving 0.666...; 25, 7 giving 3.57128...
Transcribed Image Text:3. Write an application that prompts for and reads the numerator and denominator of a fraction as integers, then displays the decimal equivalent of the fraction. Hint: This requires casting from integer to double before dividing. Testing: Submit testing exhibits using the following inputs: 0,1 giving 0.0; 1, 2 giving 0.5; 3, 8 giving 0.375; 2, 3 giving 0.666...; 25, 7 giving 3.57128...
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 4 images

Blurred answer
Knowledge Booster
Constants and Variables
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr