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
KonstantinChe [14]
2 years ago
10

Write a function that accepts a positive random number as a parameter and returns the sum of the random number's digits. Write a

program that generates random numbers until the sum of the random number's digits divides the random number without remainder. assembly language
Computers and Technology
1 answer:
Luba_88 [7]2 years ago
4 0

Answer:

Explanation:

The following Python program has a function called addDigits which takes a number as a parameter and returns the sum of the digits. Then the program creates a loop that keeps creating random numbers between 222 and 1000 and divides it by the value returned from the function addDigits. If the remainder is 0 is prints out a statement and breaks the loop, ending the program. The picture below shows the output of the program.

import random

def addDigits(num):

   sum = 0

   for x in str(num):

       sum += int(x)

   return sum

sum = addDigits(random.randint(222, 1000))

while True:

   myRandomNum = random.randint(2, 99)

   if (sum % myRandomNum) == 0:

       print("No remainder between: " + str(sum) + " and " + str(myRandomNum))

       break

You might be interested in
Sorting Records in a Form
Naya [18.7K]

Answer:

1. Open the form in the standard form view.

2. Put the cursor in the field to use for sorting.

3. Open the Home tab

4. In the Sort & Filter group, click ascending or descending

Explanation:

Took the test :)

7 0
3 years ago
Which of the following is a command shell with a built-in scripting language?1. The Server Manager’s Roles and Features wizard2.
IgorLugansk [536]
Your kinda right but wrong
4 0
3 years ago
Read 2 more answers
Why Java Script uses the prefix Java in itsname?
kifflom [539]

Answer:

Java in JavaScript does not correspond to any relationship with Java programming language.

Explanation:

The prefix Java in Javascript is there for historical reasons.

The original internal name of Javascript when it was created by Brendan Eich at Netscape was Mocha. This was released to public as Livescript in 1995. The name Livescript was eventually changed to Javascript in Netscape Navigator 2.0 beta 3 release in December 1995 after Netscape entered into an agreement with Sun Microsystem. The primary purpose of change of name seemed to be as a marketing aid to benefit from the growing popularity of Java programming language at that time.

4 0
3 years ago
Jose is upgrading the memory on his laptop. The laptop has two slots for RAM, but one of them is currently being occupied. He ha
inn [45]

Answer:

Reseat the new stick of RAM

Explanation:

Joe needs to reseat the new stick of the RAM. For that, he should gently release the clips which hold RAM in the correct posture, and one on each side. Joe is required to do this for each of the available memory modules. And then he will have the cautiously replace all the memory modules( 2 in number) through to DIMM slots which are on the motherboard. Make sure that you have noted down the locations of each notches on the RAM as well as the DIMM slots.

3 0
3 years ago
Photographs that are too dark or too light can be difficult to fix with photo-editing software.
Nana76 [90]
The answer is true :)
6 0
2 years ago
Read 2 more answers
Other questions:
  • Write a program that asks the user to enter a birth year. the program should then indicate which generation a person of that yea
    14·1 answer
  • Which letters appear in the home row on a keyboard?
    14·2 answers
  • Your organization issues devices to employees. These devices generate one-time passwords every 60 seconds. A server hosted withi
    15·1 answer
  • . Briefly describe an SQL DML statement for changing existing data in a table.
    5·1 answer
  • What happens as the key length increases in an encryption application?
    8·1 answer
  • laire writes a letter to her grandmother, in which she describes an amusement park she visited last week. She adds pictures of t
    11·1 answer
  • 9. Government and corporate officials concerned about security threats do not bring their own cell phones or laptops when travel
    9·1 answer
  • Run the browser checker to see that the computer you are using now is set up for WileyPLUS. Which of the following browser funct
    15·1 answer
  • Write a method that determines the total number of chars in each string of an array.
    12·1 answer
  • Which of these personal protective equipment items prevents injury from falling objects ?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!