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
lapo4ka [179]
3 years ago
8

Write a program that asks a user to roll a single die twice to get a sum value of 7. If the sum is 11, the user loses. If the su

m is neither 7 nor 11, the user neither wins nor loses, meaning that there is no decision. The computations have to be made inside a function named roll_die_twice. The input arguments are the numbers that show up in each die when it is rolled.

Computers and Technology
2 answers:
barxatty [35]3 years ago
6 0

Answer:

Check the explanation

Explanation:

#include <stdio.h>

int dice1;

int dice2;

int sum;

int roll_die_twice(int dice1,int dice2){

 

if(sum==7){

printf("winner");

 

}

else if (sum==11){

printf("looser");

}

else if (sum!=7 && sum!=11)

{

printf("nor winner or looser");

 

}

}

int main()

{

roll_die_twice(2,7);

return 0;

}

The code screenshot and code output can be seen in the attached image below.

Anestetic [448]3 years ago
6 0

Answer:

def roll_die_twice(num1, num2):

   if num1 + num2 == 7:

       print("You won")

   elif num1 + num2 == 11:

       print("You lost")

   elif (num1 + num2 != 7) or (num1 + num2 != 11):

       print("No winner or loser")

n1 = int(input("Roll the dice: "))

n2 = int(input("Roll the dice again: "))

roll_die_twice(n1, n2)

Explanation:

Create a function called roll_die_twice that takes two parameter, num1 and num2

Inside function, check the sum of the two numbers. If sum is equal to 7, print "You won". If sum is equal to 11, print "You lost". If sum is neither 7 nor 11, print "No winner or loser".

Get the numbers from the user

Call the function with given numbers

You might be interested in
What can you do with youtube red that you cant do with a normal account?
ipn [44]
No, Ad's. Extra Videos Created By Youtube, and thats about it lol oh and you can play the audio in the background of your phone, like lets say your listening to some music on youtube, and you want to play a game on your phone while listening to that tune on youtube, i just said screw youtube, i jailbroke my device and i have 20X more control of my youtube setting, etc.. and plus i can do more without youtube red tbh lol.
7 0
3 years ago
Read 2 more answers
True or False: You should only use your mirrors to see behind you when parallel parking.
mafiozo [28]
False. You should always look /check ou tall mirrors periodicly
8 0
3 years ago
Read 2 more answers
Please help me please and thank you!
MaRussiya [10]

Answer:

1. a digital designer involves movement like animations, movies, etc. A graphic designer is static for an example logos pictures etc.

2. a ux is the interaction between humans and products

3.  a ui is the design of software and machines, for an example computers, electronic devices, etc.

4.  textures, color, value, and space

5. the basics are contrast, balance, emphasis, white space, hierarchy, movement, proportion, repetition, pattern, variety, unity, and rhythm

6. the basic fundamentals are images, color theory, lay-out, shapes, and typograph  

I hope this helped you and have a great rest of your day

7 0
3 years ago
Consider the following code segment:
Leni [432]

The code segment is an illustration of loops and arrays

<h3>What is a loop?</h3>

A loop is a program statement used to perform repetitive operations

<h3>What is an array?</h3>

An array is a variable used to hold multiple values

<h3>How to analyze the program?</h3>

The loop of the program adds the index 0 elements of the first and the second row of the 2-dimensional array.

From the program, the numbers to add are 1 and 100

The sum of 1 and 100 is 101

Hence, 101 will be displayed when the code segment is executed

Read more about code segments at:

brainly.com/question/26683418

7 0
2 years ago
Which sentence best describes a story's rising action?
MAXImum [283]

Answer:

So first off I’m pretty sure you meant ELA class, but I will still answer the question for you. The sentence that best describes a stories rising action is when it describes the conflicts that lead to the climax of the story. The climax is the main point in a story, and usually towards the middle. (Even though this can vary in book series)

Explanation:

Rising action takes place in a book right before the climax, the main point. This really matter because they have to work it up to the climax. Think of it like a graph. The line won’t just shoot up, it will gradually go up, then gradually go down.

Hope this helped!!

6 0
3 years ago
Other questions:
  • What are preconceptions?
    9·2 answers
  • Writing a program in a language such as c or java is known as _____ the program.
    10·1 answer
  • A _____ attack keeps the target so busy responding to a stream of automated requests that legitimate users cannot get in
    9·1 answer
  • Pls give me some suggestion of good Computer Science reference books for XI CBSE. <br> PLS!!
    10·2 answers
  • You must signal ___ before any turn or lance change ?
    9·2 answers
  • 6-1) (Math: pentagonal numbers) A pentagonal number is defined as n(3n–1)/2 for n = 1, 2, . . ., and so on. Therefore, the first
    10·1 answer
  • A. Choose the correct answer.
    8·2 answers
  • CLS
    12·1 answer
  • What is destination email address​
    8·1 answer
  • Guys please tell me which cable is this?
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!