Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

on python please. Thank you Ask the user to enter the numerator and denominator of a fraction, and the position of the decimal digit they

image text in transcribed

on python please. Thank you

Ask the user to enter the numerator and denominator of a fraction, and the position of the decimal digit they want to know. For Example, if the user enters a numerator of 1 and a denominator of 7 and wants to know the 4th digit after decimal point, your program should print out 8 , because 1/7=.142856 and 8 is the 4th digit after decimal point. One way to do this is to mimic the long division process you may have learned in grade school. It can be done in about five lines using the // operator at one point in the program. Hint: In order to find the first digit of any number, it is only needed to find the reminder of that number by 10 . For example, 1275%10=5 which is the first digit of 1275. Bonus Chance: If you write this code without any loop, you will get 5% bonus of the mark of this assignment. Please mention it in your solution that this is the bonus part. Below is the expected output of the code for some example: Enter the numerator: 93 Enter the denominator: 26 Enter the position of the decimal digit that you want: 3 The answer of the division is: 3.57692307692 6 is placed in position 3 after decimal point. Programmed by Stew Dent. Date: Sun Jan 2912:15:282023 End of processing

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Datacasting How To Stream Databases Over The Internet

Authors: Jessica Keyes

1st Edition

007034678X, 978-0070346789

More Books

Students also viewed these Databases questions