1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Aleonysh [2.5K]
3 years ago
13

How to 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 in python.
Computers and Technology
1 answer:
fomenos3 years ago
3 0

Answer:

num1 = int(input("Numerator: "))

num2 = int(input("Denominator: "))

if num1 < 1 or num2<1:

     print("Input must be greater than 1")

else:

     print("Quotient: "+str(num1//num2))

     print("Remainder: "+str(num1%num2))

Explanation

The next two lines prompts the user for two numbers

<em>num1 = int(input("Numerator: "))</em>

<em>num2 = int(input("Denominator: "))</em>

The following if statement checks if one or both of the inputs is not positive

<em>if num1 < 1 or num2<1:</em>

<em>      print("Input must be greater than 1")-> If yes, the print statement is executed</em>

If otherwise, the quotient and remainder is printed

<em>else:</em>

<em>      print("Quotient: "+str(num1//num2))</em>

<em>      print("Remainder: "+str(num1%num2))</em>

<em />

You might be interested in
1
raketka [301]

1

they were crafted in stained-glass art in religious buildings

2

puzzle games

3

motion-capture devices (e.g., Kinect, WiiMote

4

puzzle

simulation

5 0
3 years ago
A program that performs handy tasks, such as computer management functions or diagnostics is often called a/an ____________.
Elodia [21]

Answer:

DOS

Explanation:

Disk operating

4 0
2 years ago
Give a tight bound on the number of times the z = z + 1 statement is executed. i = 2 while ( i &gt; 1 ) { i = floor(i/2) z = z +
Alinara [238K]

Answer:

zero ( 0) times.

Explanation:

In the code;

i = 2

while ( i > 2){

     i = floor( i/2 );

     z = z + 1;

}

the variable " i " is assigned the integer " 2 ", then the while statement loops with a condition of a greater " i " value and divides the value by two for every loop.

But in this case, the while statement is not executed as the value of " i " which is 2 is not greater than but equal to two.

4 0
2 years ago
Look at the pic. I know what girls be going through like us girls aren't toys. Please stop, please.
mixas84 [53]

Answer:

No need to be overly-sensitive, brainly deleted that question

If no one joins then its not a problem

6 0
2 years ago
Read 2 more answers
Which of the following is a principle that can improve the efficiency of I/O?
natulia [17]

Answer:

C)

Explanation:

One principle that can improve the efficiency of I/O would be to move processing primitives into hardware. Primitives are a semantic value representing something else such as words or numbers within the programming language. By moving them into hardware they system is able to read them at a much faster speed making the I/O more efficient.

5 0
2 years ago
Read 2 more answers
Other questions:
  • Billy used to take care of his laptop. However, one day he lost his laptop. He lost all his data, and there was no way to retrie
    10·2 answers
  • How has the Internet changed the design industry?
    12·1 answer
  • What is one problem you should keep in mind when researching information on the Internet?
    6·2 answers
  • Summary In this lab, you declare and initialize variables in a C++ program. The program, which is saved in a file named NewAge.c
    5·1 answer
  • Write a program which simulate rolling dice. When the program runs, it will prompt the user to choose a number ranging from 1 to
    15·1 answer
  • Your company has a wireless network for its small office network. The wireless network does not broadcast its service set identi
    11·1 answer
  • What are some things you can do to clean up your digital footprint.
    9·1 answer
  • What happens when you apply a theme to a form?
    14·1 answer
  • Help help help help help!!!
    7·1 answer
  • Explain what a datalist element does and is used for.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!