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
sertanlavr [38]
2 years ago
8

The block of code below is supposed to display “multiple of 5” if the positive number value is in fact a multiple of 5

Computers and Technology
1 answer:
12345 [234]2 years ago
3 0

Answer:

Answer is (value MOD 5) = 0.

Explanation:

A number A is multiple of another number B  if after dividing A by B remainder value is zero.

In mathematics modulo or (MOD) function is a function which returns remainder value after dividing two numbers.

Here in question for condition

( value MOD 5 ) = 0 code will print "Multiple of 5". For each value which is divisible by 5 we will get zero remainder implying that value is a multiple of 5.

You might be interested in
What were the first microblogs known as
Greeley [361]
The first micro blogs was once known a tumblogs
6 0
3 years ago
Read 2 more answers
The steps.txt file contains the number of steps a person has taken each day for a year. There are 365 lines in the file, and eac
Bumek [7]

Answer:

In Python:

file = open('steps.txt', 'r')

readLine = file.readlines()

begin = 0

mdays = (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)

print("Month"+"\t\t"+"Average Steps")

for m in range(len(mdays)):

end = begin + mdays[m]

steps = readLine[begin:end]

sumsteps = 0

for s in steps:

 sumsteps = sumsteps + int(s)

 

average = round(sumsteps/mdays[m],1)

print(str(m+1)+"\t\t"+str(average))

begin = begin + mdays[m]

Explanation:

This line opens the step.txt file

file = open('steps.txt', 'r')

This reads the content of the file

readLine = file.readlines()

begin = 0

This initializes the months of the days to a tuple

Mmdays = (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)

This prints the header

print("Month"+"\t\t"+"Average Steps")

This iterates through the tuple

for m in range(len(Mmdays)):

This calculates the days in each month

end = begin + Mmdays[m]

This gets the number of steps in each month

steps = readLine[begin:end]

This initializes the number of steps to 0

sumsteps = 0

This iteration sums up the number of steps in each month

<em> for s in steps: </em>

<em>  sumsteps = sumsteps + int(s) </em>

This calculates the average of steps rounded to 1 decimal place  

average = round(sumsteps/Mmdays[m],1)

This prints the calculated average

print(str(m+1)+"\t\t"+str(average))

This calculates the beginning of the new month

begin = begin + Mmdays[m]

8 0
3 years ago
If int a = 4, int *b = &amp;a , int **c= &amp;b;<br> what is the value store in c.
Elenna [48]

Answer:

5.

Explanation:

6 0
3 years ago
PLEASE HELP
Zinaida [17]

Answer:

B from you search question carefully and identify the key word

Explanation:

3 0
3 years ago
Read 2 more answers
What is the most efficient<br> form of transportation we<br> have?
alisha [4.7K]

Answer:

The bicycle is a tremendously efficient means of transportation. In fact cycling is more efficient than any other method of travel--including walking! The one billion bicycles in the world are a testament to its effectiveness

Explanation:

6 0
2 years ago
Read 2 more answers
Other questions:
  • Corey is an architect. What software does he most likely use to design houses? graphic software scheduling software CAD software
    10·2 answers
  • Write a function SwapArrayEnds() that swaps the first and last elements of the function's array parameter. Ex: sortArray = {10,
    8·1 answer
  • 1. The best program to present numerical data in would be ____. a. Access c. PowerPoint b. Excel d. Word
    6·1 answer
  • "Which of the following is not an example of a project? Select one: a. Creating a website for a company b. Raising money for a d
    5·1 answer
  • When addictions escalate and the individual loses his or her job or drops out of school, _______________.
    12·2 answers
  • Audiovisual means that a presentation combines film and photos.<br> true or false?
    6·2 answers
  • My friend Leo wants to have an emergency plan for his final exams on University of Southern Algorithmville. He has N subjects to
    6·1 answer
  • 4.7 code practice question 2 edhesive i cant figure out the code for this problem csn anyone help me?
    5·1 answer
  • Explain any two features of a computer​
    15·1 answer
  • A machine that converts energy to useful work.
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!