Question: Problem 1 - Filename: HexNoConversion Write a program that converts a rational value less than one into hexadecimal form. Input from the keyboard a positive

Problem 1- Filename: HexNoConversion
Write a program that converts a rational value less than one into hexadecimal form. Input from the
keyboard a positive rational (decimal) number. Assume proper input. Output to the screen the value
converted to hexadecimal using the following rules:
If the conversion includes a repeating decimal, output only one section of the repeating part. For
example, output .101101101dots16 as .101
If the converted decimal does not repeat within the first 15 digits only output the first 10 digits
Do not output any repeating zeros at the end of a hex value
Do not output the integer part of a number (0.8 verses .8)
Finally, the program should ask if the user wants to run the program again (Check case). Refer to the
sample output below.
Sample Run:
Enter value: .65
Hexadecimal: .A6
Run again (YN):y
Enter value: .144
Hexadecimal: .24DD2F1A9F
Run again (YN) : N
Problem 1 - Filename: HexNoConversion Write a

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Programming Questions!