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]
4 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:
fomenos4 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
A personal business letter is a letter that is ____.
Simora [160]

Answer:

Explanation:

One group of students did an experiment to study the movement of ocean water. The steps of the experiment are listed below.

Fill a rectangular baking glass dish with water.

Place a plastic bag with ice in the water near the left edge of the dish.

Place a lighted lamp near the left edge of the dish so that its light falls directly on the plastic bag.

Put a few drops of ink in the water.

The student did not observe any circulation of ink in the water as expected because the experiment had a flaw. Which of these statements best describes the flaw in the experiment? (2 points)

Not enough ink was added.

Not enough water was taken.

The dish was too small for the experiment.

The lamp and the ice bag were at the same place.

8 0
3 years ago
Write a Bare Bones program that takes as input a value for X and places 4 times the value of X into the value of Z. The value of
Vlada [557]

Answer:

See the code snippet in the explanation section

Explanation:

import java.util.Scanner;

public class BareBonesProgram{

public static void main (String[] args){

 Scanner scan = new Scanner(System.in);

 System.out.println("Please enter the value of x: ");

 int x = scan.nextInt();

 int z = 4 * x;

 System.out.println("The value of z is: " + z);

 System.out.println("The value of x is: " + x);

}

}

6 0
3 years ago
A student will not be allowed to sit in exam if his/her attendance is less than 75% .
Oxana [17]

Answer:

Sorry, this is too vague to understand as you don’t have any charts, graphs, or anything

Explanation:

6 0
3 years ago
HELP ASAP
CaHeK987 [17]
The answer is B, e commerce. Have a good day
3 0
3 years ago
What is LATEX ? <br>create a latex command
AVprozaik [17]

Latex is a software used for writing daily life issue like integrations,fractions ,limits .

Lets see an example

\\ \bull\tt\longmapsto \displaystyle{\int}vdx

\\ \bull\tt\longmapsto \displaystyle{\lim_{x\to 0}}

5 0
3 years ago
Other questions:
  • Which answer best describes an unsubsidized federal loan
    9·1 answer
  • 1. Think about the various ways in which you have seen hackers portrayed in popular media over the past few years. Are they hero
    11·1 answer
  • Design an application that has an array of at least 20 integers. It should call a module that uses the sequential search algorit
    13·1 answer
  • (Java)
    12·1 answer
  • Balance is the design principle that is represented when using the Crop tool?
    6·1 answer
  • 1. Consider a direct-mapped cache that can accommodate 8Mbytes from a main memory, that uses a 32-bit address and 32-byte blocks
    5·1 answer
  • What will be the result of running the following code fragment? int year = 0; double rate = 5; double principal = 10000; double
    14·1 answer
  • Write a method that takes in a String and returns a new
    15·1 answer
  • Which encryption standard goes with the WPA2 protocol?<br> AES<br> DES<br> TKIP<br> WPS
    15·1 answer
  • Complete the function by filling in the missing parts. The color_translator function receives the name of a color, then prints i
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!