answer.
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]
2 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:
fomenos2 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
Jane's organization recently experienced a security incident that occurred when malware set to trigger on the chief executive of
inn [45]

Answer:

The answer is viruses

Explanation:

Because it is a harmful software hidden inside another  and usually performs a harmful action, such as destroying data.

4 0
2 years ago
Light travels at 3 × 108 meters per second. A light-year is the distance a light beam travels in one year.Write a PYTHON program
Art [367]

Answer: This is a python code

def lightyear():

   rate=3*100000000   //speed of light

   seconds=365*24*60*60   //number of seconds in 1 year

   return str((rate*seconds)/1000)+" km"    //distance=speed x time

print(lightyear()) //will print value of light hear in kilometers

OUTPUT :

9460800000000.0 km

Explanation:

In the above code, there is a variable rate, which stores the speed of light, i.e. distance traveled by light in 1 second which is in meters. Another variable is seconds, which store the number of seconds in 1 year, which is no of days in 1 year multiplied by the number of hours in a day multiplied by the number of minutes in an hour multiplied by the number of seconds in a minute. Finally, distance is speed multiplied by time, so distance is printed in kilometers and to convert distance in kilometers it is divided by 1000.

4 0
1 year ago
1.2.2: Output variable value. Jump to level 1 Write a statement that outputs variable userAge. End with a newline. 1 2 3 4 5 6 7
serg [7]

Answer:

cout<<"User Age is ="<<userAge<<endl;

Explanation:

#include<iostream>

using namespace std;

int main()

{

int userAge;

cin >> userAge; // Program will be tested with values: 15, 40.

cout<<"User Age is ="<<userAge<<endl;

return 0;

}

5 0
2 years ago
This program finds the sum and average of three numbers. What are the proper codes for Lines a and b?
Gennadij [26K]

Answer:

The Proper codes in Line a and Line b is given below

average=Sum/3  

print (" Average is = ", average)

Explanation:

In the given question it calculated the sum but the program does not calculate the average of the 3 numbers.The average of the 3 number is calculated by using average=Sum/3   statement so we add this code in Line a then After that print the value of average by using the print function so we add this code in Line b.

4 0
1 year ago
Read 2 more answers
You resurrected an old worksheet. It appears to contain most of the information that you need, but not all of it. Which step sho
shtirl [24]

Answer:

a)

Explanation:

Since the worksheet contains most of the data that you need, there is a decent possibility that it also contains the data that you are missing. Therefore, you should check for data you have previously hidden. Sometimes, some data in a worksheet may become irrelevant in a given moment, and instead of deleting it since it may be useful later most people tend to make that data hidden. So checking for previously hidden data may be the best solution in this scenario.

7 0
1 year ago
Other questions:
  • Suppose you develop an app and want to generate revenue but do not want to maintain the app. What would be your best choice?
    9·1 answer
  • Use a VLOOKUP function in cell I5 to identify and calculate the federal withholding tax. Use the tax rates from the range D21:E2
    15·1 answer
  • A business wants to centralize its administrative tasks. At the same time, it wants the existing systems to manage and sustain t
    14·2 answers
  • When workers demonstrate patience, are able to manage there emotions, and get along with other employees, which skills are being
    11·2 answers
  • vertical exchanges are typically used only to buy and sell materials required for an organization's support activities ( True or
    14·2 answers
  • Suppose that a scheduling algorithm (at the level of short-term CPU scheduling) favors those processes that have used the least
    10·1 answer
  • What is the Gain (dB) of a transmission if the Maximum Data Rate is 1 Gbps and the Bandwidth =7000 MHz? Group of answer choices
    6·1 answer
  • Write a program that calculates an adult's fat-burning heart rate, which is 70% of 220 minus the person's age. Complete fat_burn
    10·1 answer
  • 1. The precious metals needed to make computer chips, graphic cards, and transistors are found in only a small population of cou
    8·1 answer
  • Suspicious activity, like IP addresses or ports being scanned sequentially, is a sign of which type of attack?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!