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
Kobotan [32]
4 years ago
8

Write a method isMultiple that determines, for a pair of integers, whether the second integer is a multiple of the first. The me

thod should take two integer arguments and return 1 if the second is a multiple of the first and 0 otherwise.
Computers and Technology
2 answers:
SVEN [57.7K]4 years ago
8 0

Answer:

See the explanation

Explanation:

Given to integers a,b we can find integers k,r such that a = kb +r, where r is called the residue, where |r|<|b|. When r = 0, we say that a is a multiple of b. Based on that, we define the function %(a,b) which gives out the residue between a,b. For example %(4,3) =1 since 4 = 1*3 +1.

The main idea of the program should be: if the residue is 0, then they are multiples and it should return 1, otherwise, return 0.

Let us use the following syntaxis function name (parameter 1, parameter 2).

So, we have

isMultiple(a,b) {

if %(a,b)=0 (this means they are multiples)

then return 1

else return 0

end

}

NNADVOKAT [17]4 years ago
3 0
I don't know what language you want it in but I will write this in Java.

public int isMultiple(int x, int y) {
    if (x % y == 0)
        return 1;
    return 0;
}

The mod function (%) returns 0 iff x divides y.
Feel free to ask me questions!
You might be interested in
What do you think is the most important part of the history of internet what event has had the biggest impact on your daily life
dalvyx [7]

Explanation:

The Internet started in the 1960s as a way for government researchers to share information. ... This eventually led to the formation of the ARPANET (Advanced Research Projects Agency Network), the network that ultimately evolved into what we now know as the Internet.

6 0
3 years ago
Read 2 more answers
Which is a reason why an organization might get rid of its entire information processing unit?
Rasek [7]

Answer: To hire good IT staff

Explanation:

  The organization hire the good information technology staff so that it can help in the development and increase the productivity of the organization. The stronger employees means the company become more strong in terms of growth and productivity.  

The organization always maintain the quality of the employees so that it can help to increase the quality of the projects and services that is provided to the users.

The good information technology (IT) staff can deliver the good products and can also providing the relevant services  for the organization.

6 0
3 years ago
Can any software run on any processor
jekas [21]

Answer:

Yes.

Explanation:

Your software requires CPU instruction if CPU doesn't provide that instructions the software won't work/run.

hope this helps you

have a great day:)

6 0
3 years ago
PLZZZZ I NEED THE ANSWER NOW PLZZZZ!!!!!!!!!!!!!!!!!!!!!!!!! Which one of the following is considered a peripheral? A Software B
kaheart [24]

D is the answer  motherboard is correct

3 0
3 years ago
A short story, but i remember in 1nd - 5th grade at my elementary school here is the list from first to last for being cool at s
Evgen [1.6K]

We all live similar lives don't we.

3 0
3 years ago
Read 2 more answers
Other questions:
  • Help me!!!!! This is the last question! HELP ME! I REPEAT: HELP ME!!!! I AM SO IN NEED!!!
    12·2 answers
  • How has information technology made piracy possible?
    6·1 answer
  • The Task Manager cannot be used to turn Services on and off.<br> True or False?
    8·2 answers
  • Signs that a listener is paying attention include:
    10·2 answers
  • How do you think engel would feel about computers information systems and the internet?
    14·2 answers
  • Which of the following is the definition of Internet Protocol Security ( IPSec)? A remote access client/server protocol. It is a
    13·2 answers
  • Visme,PowerPoint, keynote and prezi are what kind of software
    15·1 answer
  • How many sets of number do both Hex and RGB values have?
    10·1 answer
  • Imagine you’re at lunch. Your nose smells pizza. Your legs move over to where hot lunch is being served. You have to balance the
    9·2 answers
  • T<br> N<br> O<br> ?<br> You can insert only the row<br> only to<br> True or false
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!