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
denis23 [38]
3 years ago
4

LAB: Divide input integers

Computers and Technology
1 answer:
Brums [2.3K]3 years ago
7 0
Mark Brainliest please


Answer:
# The user is prompted to enter number as dividend
# The received number is assigned to userNum
userNum = int(input("Enter the number you want to divide: "))
# The user is prompted to enter number as divisor
# The divisor is assigned to x
x = int(input("Enter the number of times to divide: "))
# divideNumber function is defined to do the division
def divideNumber(userNum, x):
# counter is declared to control the loop
counter = 1
# the while-loop loop 3 times
# the division is done 3 times
while counter <= 3:
# integer division is done
# truncating the remainder part
userNum = userNum // x
# the result of the division is printed
print(userNum, end=" ")
# the counter is incremented
counter += 1
# the divideNumber function is called
# the received input is passed as parameter
# to the function
divideNumber(userNum, x)
# empty line is printed
print("\n")
Explanation:
The // operator in python works like the / operator in C. The // operator returns only the integer part of division operation. For instance 6 // 4 = 1. The fraction part is discarded
You might be interested in
Which soft skills would these mobile app developers need to use in the situations described?
Ber [7]

Answer:

1: work ethic/presentation.

2: communication.

3: adaptability.

4: creativity.

(these are all guesses so i'm not 100% sure)

Explanation:

6 0
3 years ago
Read 2 more answers
Which of the following methods is a static method? The class in which the method is defined is given in parentheses following th
maw [93]

Answer:

C. sqrt(Math)

Explanation:

All but one of options A to E are is not a static method.

Only option C is a static method. The sqrt() is a static method of Math, that can always be used as Math.sqrt() is used;

The Math class defines all of its methods to be static. Invoking Math methods is done by using Math as a method rather than a variable of type Math; this means that sqrt(Math) doesn't rely on instance variables and don't need to be overridden, unlike others.

Lastly, sqrt(Math) is a static method because unlike other options, it is an utility method, and it is relevant to computations on primitive data types.

The purpose of the static method is in large part to offer a standard library of functions, and it doesn't need to be applied directly to an object.

4 0
3 years ago
I need help answering these questions!
Elanso [62]
1. telephone
2. Telegraph machine
4 0
3 years ago
Two ways of calculating average returns are ______ and ______. Multiple select question. the arithmetic average the progressive
joja [24]

Answer:

"Geometric Average Return Example. Jennifer has invested $5,000 into a money market that earns 10% in year one, 6% in year two, and 2% in year three. If you were to calculate this using the arithmetic mean return, you would add the rates together and divide them by three, giving you an average of 6%."

Explanation:

6 0
2 years ago
What can I do If my Texas Instrument TI-84 calculator is not giving accurate answers?
zlopas [31]

Answer:

replace the batteries possibly

Explanation:

4 0
2 years ago
Other questions:
  • The RAM is a type of ____ a.Main Memory b.Secondary Memory c.Human Memory d.EPROM e.EEPROM
    13·2 answers
  • When a defendant pleads guilty to one offense just to have another offense dropped, this is what type of plea bargain
    14·2 answers
  • What important practice can help prevent hardware trouble?
    6·1 answer
  • What is a wireless network that provides communication over a short distance that is intended for use with devices that are owne
    14·2 answers
  • Convert 4.5 strides to girth
    10·1 answer
  • A(n) ___________________________________ is a legal contract between a vendor and a user that governs the use of a software pack
    11·1 answer
  • __________ systems support the search for and sharing of organizational expertise, decision making, and collaboration at the org
    9·1 answer
  • What would the math equation x = y create?
    9·1 answer
  • Explain two ways that you can create a header.
    14·1 answer
  • During the POST process, the BIOS uses two (2) different ways to notify you of a problem, Error beep codes and error messages, e
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!