subject

Warm up: simplify fraction (python 3) overview: we ask the user for the numerator and denominator of a fraction and compute its simplified form. ask the user for a fraction. the fraction should have the format integer/integer. you will need to parse the input on the forward slash to find the numerator and denominator. computer the gcd divide both by the gcd and print out the new fraction the greatest commorn demoninator of two integers is easy to implement recursively. you will not receive credit if your solution is not recursive. if the denominator is 1, then only print the numerator. do not print 5/1, just print 5. the gcd function must have the format def gcd(a, b). the goda,0)=a for any integer a. for all other values in the second input, gcd(ab)-gcd(b, a % b) ask for fractions and simplify them until the user enters 'exit' as their fraction. remember to include if name_main_" so zybooks can include your functions for testing example welcome to fraction simplifier type "exit" to quit enter fraction (int/int): 125/55 simplified fraction enter fraction (int/int): 8/2 simplified fraction enter fraction (int/int): 27/9 simplified fraction enter fraction (int/int): 76/92 simplified fraction 19/23 enter fraction (int/int): exit bye

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 11:00
The isometric projection camera technique provides an illusion of perspective by using things like parallax scrolling to create the illusion of 3d in a 2d game
Answers: 3
question
Computers and Technology, 23.06.2019 02:30
These factors limit the ability to attach files to e-mail messages. location of sender recipient's ability to open file size of file type of operating system used
Answers: 2
question
Computers and Technology, 23.06.2019 03:10
Fill in the following program so that it will correctly calculate the price of the orange juice the user is buying based on the buy one get one sale.#include //main functionint main() { int cartons; float price, total; //prompt user for input information printf("what is the cost of one container of oj in dollars? \n"); scanf(" [ select ] ["%d", "%c", "%f", "%lf"] ", & price); printf("how many containers are you buying? \n"); scanf(" [ select ] ["%d", "%c", "%f", "%lf"] ", & cartons); if ( [ select ] ["cartons / 2", "cartons % 1", "cartons % 2", "cartons % price", "cartons / price", "cartons / total"] [ select ] ["=", "==", "! =", "< =", "> =", "< "] 0) total = [ select ] ["price * cartons", "cartons * price / 2 + price", "(cartons / 2) * price", "cartons / (2.0 * price)", "(cartons / 2.0) * price + price", "((cartons / 2) * price) + price"] ; else total = ((cartons / 2) * price) + price; printf("the total cost is $%.2f.\n", total); return 0; }
Answers: 2
question
Computers and Technology, 23.06.2019 11:00
What is the name of the sound effect that danny hears
Answers: 1
You know the right answer?
Warm up: simplify fraction (python 3) overview: we ask the user for the numerator and denominator...
Questions
question
English, 27.10.2021 22:00
question
History, 27.10.2021 22:00
question
Mathematics, 27.10.2021 22:00
Questions on the website: 13722363