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]
3 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]3 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]3 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
1. If you purchase the renters insurance policy described above, you bring a suitcase of clothing and other general
Mazyrski [523]

Answer:

I think its c or d

Explanation:

hope this helps

7 0
3 years ago
Which statement does not describe the guidelines for the use of text in presentation programs?
olganol [36]
Choice a
have a great day

7 0
3 years ago
How do you design and create video games for what console game That you want To have it in
Yakvenalex [24]

Answer

Making a video game is much less daunting than it might seem. While you likely aren’t going to go from having no experience to making the next Grand Theft Auto, it has actually never been easier to get started making games. Game development tools and resources have become increasingly accessible to the average person, even if they have no programming experience. Often these tools are also available for free.

To try to make things easier for those looking to get started making games, we’ve put together a list of 11 game engines / editors. Some are designed for a specific genre of game or to be incredibly easy for newcomers. Others are professional development tools for AAA games, but are effectively free to use for hobbyists and still offer a lot of learning tools to help those with limited programming experience get started.

There are, of course, a lot of things that go into game development — music, animation, sound, writing, texturing, modeling, etc. — however, the game engine / editor you choose is going to have the biggest effect on what kind of game you can make. If you have suggestions for other engines, software, or learning tools for the other aspects of development, post it in the comments.

7 0
2 years ago
Please answer this question​
RSB [31]

Answer:

what is the other language

is it Assamese clarify me in the comment section bro

4 0
3 years ago
Collins and quillian explained the results of priming experiments by introducing the concept of _____ into their network model.
insens350 [35]
<span>Spreading Activation This is a model of working memory, which can be otherwise called here and now memory in lay man's term, that tries to clarify how the mind forms related thoughts, particularly semantic or verbal ideas. The spreading enactment show is one way intellectual clinicians clarify the preparing impact, which is the noticeable wonder that a man can all the more rapidly review data about a subject once a related idea has been presented. As indicated by this model, semantic long haul memory comprises of a huge, interrelated system of ideas. At the point when a man is given any idea, the ideas most firmly associated with it are initiated in that individual's psyche, getting ready or "preparing" him or her to review data identified with any of them</span>
4 0
3 years ago
Other questions:
  • You run an automobile selling company that has a popular online store on AWS. The application sits behind an Auto Scaling group
    6·1 answer
  • Which kind of software allows users to draw pictures, shapes, and other graphical images with various on-screen tools such as a
    14·1 answer
  • Enter the number 2568 into the box below
    14·1 answer
  • You have dinner with your family and tell them that you have taken bcis. your mother tells you that she is proud of you and that
    9·1 answer
  • Hurry please
    12·1 answer
  • An IP address in the form 197.169.100.1 is called a(n) ________. dotted quad encryption key random number sequential access numb
    7·1 answer
  • Imagine you are responsible for making a presentation that includes a representation of the logic flow through a process. You un
    11·1 answer
  • How do you change your username
    6·2 answers
  • Els
    6·1 answer
  • What describes a group of cells?<br> O crowd<br> Orange<br> O set<br> gangle
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!