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
just olya [345]
2 years ago
15

In what real-life situations might you want to use the modulus operation in a program?

Computers and Technology
1 answer:
KonstantinChe [14]2 years ago
5 0

Answer:

Since any even number divided by 2 has a remainder of 0, we can use modulo to determine the even-ess of a number. This can be used to make every other row in a table a certain color, for example.

You might be interested in
Show how to define a view tot_credits (year, num_credits), giving the total number of credits taken by students in each year
andreev551 [17]

Hi! I'm a Digital Marketer Intern at hotels.ng and I have a moderate knowledge on programming.

First, your  question is not very explanatory. The term "view" is often used in back-end web development. A view is simply a Python function that takes a Web request and returns a Web response.

But I'm not sure this is what you want, so I'll just go ahead and write a python function involving class to return the total number of credits taken by a student.

I'll answer this question using Python.

class student(object):  

    credits = None

    year = None

    def num_credits(self):


       #get credit value

       self.credits = input("Enter the total number of credits: "  )


       pass

    def getYear(self):

        self.year = input("Enter current year: ")

        pass

    def tot_credits(self):

          TotalCredits = tempTotalCredits + self.num_credits

           print "Your  total credits are :"+" "+str(TotalCredits)




3 0
3 years ago
What is your perception of what a safe classroom looks like
Andreyy89

Answer:

6 feet apart

Explanation:

6 0
3 years ago
One property of light that makes it possible to record the image of an object with the camera
KengaRu [80]

Answer:

Reflection

Explanation:

Reflection is the property of light in which when a ray of light hits a smooth surface, it bounces back in the direction in which it came from. If i is the angle between the normal to the surface and the incident ray, and r is the angle between the normal and reflected ray, the law of reflection states that the angle of incidence equals the angle of reflection. That is, i = r.

So, to record the image of an object with a camera, one property of light that makes that possible is reflection because, the incidence rays form an image of the object in the camera, while the reflected rays reflect the image so that it is visible to the eye.

7 0
3 years ago
A computer user who purchases a software package that will not operate on his or her hardware configuration is a victim of which
Natalija [7]
Is this a math problem? I don't get what you are trying to say sorry
5 0
3 years ago
Write a function wordcount() that takes the name of a text file as input and prints the number of occurrences of every word in t
artcher [175]

Answer:

Explanation:

The following Python program uses a combination of dictionary, list, regex, and loops to accomplish what was requested. The function takes a file name as input, reads the file, and saves the individual words in a list. Then it loops through the list, adding each word into a dictionary with the number of times it appears. If the word is already in the dictionary it adds 1 to its count value. The program was tested with a file named great_expectations.txt and the output can be seen below.

import re

def wordCount(fileName):

   file = open(fileName, 'r')

   wordList = file.read().lower()

   wordList = re.split('\s', wordList)

   wordDict = {}

   for word in wordList:

       if word in wordDict:

           wordDict[word] = wordDict.get(word) + 1

       else:

           wordDict[word] = 1

   print(wordDict)

wordCount('great_expectations.txt')

4 0
3 years ago
Other questions:
  • Suppose you're trying to remove the clamp from a ground strap that's connected to a battery. The clamp won't come loose. Which o
    14·2 answers
  • Which of the following is a narrative essay most like
    8·2 answers
  • toThePowerOf is a method that accepts two int arguments and returns the value of the first parameter raised to the power of the
    6·1 answer
  • The Internet may best be compared to a/an
    8·1 answer
  • A mobile device is freezing almost daily. The device remains powered on and the screen illuminated. The user restarts the device
    8·1 answer
  • You are given an array of integers, each with an unknown number of digits. You are also told the total number of digits of all t
    7·1 answer
  • How can you know if the person or organization providing the information has the credentials and knowledge to speak on this topi
    13·1 answer
  • What are some characteristics of filtering junk email in Outlook 2016? Check all that apply.
    10·2 answers
  • If you are going to refer to a few dozen classes in your application, how do<br> you do it?
    6·1 answer
  • You receive an email that appears to legitimately be from your Bank. The email indicates the need for verification of your infor
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!