91.6k views
1 vote
Write a program that prompts the user to input two POSITIVE numbers — a dividend (numerator) and a divisor (denominator). Your program should then divide the numerator by the denominator, and display the quotient followed by the remainder.

Hint: If you use division (/) to calculate the quotient, you will need to use int() to remove the decimals. You can also use integer division (// ), which was introduced in Question 10 of Lesson Practice 2.3.


Once you've calculated the quotient, you will need to use modular division (%) to calculate the remainder. Remember to clearly define the data types for all inputs in your code. You may need to use float( ) , int( ), and str( ) in your solution.


float( ): Anything inputted by a user should be transformed into a float — after all, we are accepting ALL positive numbers, integers and those with decimals.


int( ): When you divide the numerator and the divisor using /, make sure that the result is an integer.


str( ): After using modular division, you can transform the quotient and remainder back into strings to display the result in the print() command.

User Kenric
by
4.1k points

1 Answer

4 votes

Answer:

yes

Step-by-step explanation:

User Stormwild
by
4.6k points