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
Softa [21]
2 years ago
10

The algorithm below simulates rolling a regular 6-sided die twice. Consider the goal of determining if the sum of the values of

the two rolls is odd or even.
Step 1: Using a random number generator, get a value between
1 - 6 inclusively
Step 2: Remember that number
Step 3: Repeat steps 1 and 2
Step 4: Add the two remembered numbers together
Step 5: Multiply that sum by 10
Step 6: Divide the result of that multiplication by 2


What conclusions can be made with regard to what we are trying to determine? Select two answers:

Group of answer choices

If the value found in step 6 is 10, 20, 30, 40, 50 or 60 then the sum is even

If the last digit of the value found in step 6 is 5, then the sum is odd

If the value found in step 6 is 10, 30 or 50 then the sum is odd

If the value found in step 6 is not 20, 40, 60, 80, 100 or 120 then the sum is odd
Advanced Placement (AP)
1 answer:
FrozenT [24]2 years ago
7 0

Algorithms are used to simulate real programs.

The true conditions of the algorithm are:

  • <em>(a) If the value found in step 6 is 10, 20, 30, 40, 50 or 60 then the sum is even </em>
  • <em>(b) If the last digit of the value found in step 6 is 5, then the sum is odd</em>

First, we analyze the algorithm.

Assume the outcomes of the two rolls are x and y

<u>Step 4: Calculate sum</u>

Sum = x + y

<u>Step 5: Multiply Sum by 10</u>

Result =  Sum \times 10

<u>Step 6: Divide by 2</u>

Result =  Sum \times 10 \div 2

Result =  Sum \times 5

This means that, the algorithm simply multiplies the sum of the rolls by 5

<u>Option (a): If step 6 is 10, 20, 30, 40, 50 or 60, then sum is even</u>

Make Sum the subject in Result =  Sum \times 5

Sum = \frac{Result}{5}

When 10, 20, 30, 40, 50 and 60 are divided by 5, the result is:

Sum = 2, 4,6,8,10, 12

All the above numbers are even number.

This means that, the sum is an even number.

<em>Hence, (a) is true</em>

<u>Option (b): If the last digit of step 6 is 5, then the sum is Odd.</u>

The possible sum of two rolls of dice, where the last digit ends in 5 are:

5, 15, 25, 35

When each of these are divided by 5, the result is:

Sum = 1,3,5,7

It is not possible to have a sum of 1 for two rolls

So, we have:

Sum = 3,5,7

All the above numbers are odd.

This means that, the sum is an odd number.

<em>Hence, (b) is true</em>

So, we can conclude that the true conditions are:

(a) and (b)

Read more about algorithms at:

brainly.com/question/17780739

You might be interested in
G tincture ftfjdxo jckmbuucv ?
avanturin [10]
That's not a question... this is a waste of someone's time!!
5 0
3 years ago
Which advantages are part of renting a home?
kvv77 [185]

Homeowners can make a profit on the sale of their home.

easy to move

-low maintenance responsibility

-low financial commitment

8 0
3 years ago
Two lights will be arranged on a two-dimensional plane. The vertical distance between the two lights is stored in the double var
lbvjy [14]

Answer:

double a;

double b;

double distance = Math.sqrt( (Math.pow(a, 2) + Math.pow(b, 2));

System.out.println("The distance is: " + distance);

Explanation:

The code snippet is written in Java.

First, variable a is declared as a type of double and variable b is also declared as a type of double.

The given formula for the distance is:

√(a² + b²)

So we use the inbuilt function of Java to calculate the power and the square root.

Math.sqrt is to find the square root and it returns a value of type double.

Math.pow is use to calculate the value of a² and b².

a² = Math.pow(a, 2)

b² = Math.pow(b, 2)

Then Math.sqrt is applied to the sum of Math.pow(a, 2) and Math.pow(b, 2), the value is assigned to distance of type double.

The value of distance is now displayed to the user:

System.out.println("The distance is: " + distance);

6 0
2 years ago
Ryan is a young teen who has constant access to the Internet. In what way is he likely to misuse this access?
erik [133]

Answer:

B. by chatting with friends

C. by downloading violent or sexual content

Explanation: The immoderate use of internet can decrease Ryan's concentration for studying and lead him to explore deeper into the internet world. By having access to almost everything online, he can delve into online sexual content and develop interest in it. Since the content varies, it is most likely for Ryan to get attracted to violent content. Also, as a teenager, instead of using internet to gather information for a lecture or a test, he can quickly lose interest by being online with his friends constantly. Therefore, it is very important for parents to have some kind of control of the teenager's online surfing since it can deeply affect his concentration, mental health and view of sexual intercourse.

4 0
3 years ago
.......
Anika [276]

Answer: He drank 15 cups all together :)

4 0
3 years ago
Read 2 more answers
Other questions:
  • The way you want to spend your time, money, and resources in the future are your _____. a. interests b. lifestyle goals c. aptit
    7·2 answers
  • Which country has had the greatest number of repatriated refugees?
    15·1 answer
  • you are walking down a trail and you come to a pont where the trai splits. one route goes to a village where everyone lies. the
    10·1 answer
  • In a pinch, a pile of bricks or water pipes can be used in place of jack stands when using hydraulic jacks true or false?
    15·2 answers
  • Did the patriots<br><br> a) cheat<br> b) win<br> c) invasion <br> d) lost
    11·2 answers
  • Which statement is true about architectural photography?
    8·2 answers
  • Name at least two pieces of information that might be found in stock listings
    14·1 answer
  • How do this global cities create a network of international relations and connections?
    9·1 answer
  • Individuals who suffer from a mental disorder are most likely to commit violent crimes. T or F
    9·2 answers
  • Which elements of an MLA citation appear in italics? Check all that apply.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!