Question: Write a program that prompts the user to enter a decimal number and displays the number in a fraction. Listing JEnter Enter a decimal number:

Write a program that prompts the user to enter a decimal number and displays the number in a fraction.JEnter Enter a decimal number: 3.25 The fraction number is 13/4 JEnter

Enter a decimal number: -0.45452 The fraction number is -11363/25000

Listing

image

JEnter Enter a decimal number: 3.25 The fraction number is 13/4 JEnter Enter a decimal number: -0.45452 The fraction number is -11363/25000

Step by Step Solution

3.37 Rating (169 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Program Plan 1 Create a class Rational 2 Declare and Initialize the private members numerator and de... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Java Programming Questions!