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
aliina [53]
2 years ago
5

Write a Dice Game program that generates two random dice values between 1 and 6 for you, and 2 for the computer. You get to roll

as many times as you like (if you don't like your 2 dice), while the computer only rolls once, after you have decided that you like your two dice. Determine who wins, you or the computer. g
Computers and Technology
1 answer:
charle [14.2K]2 years ago
6 0

Answer:

#include <iostream>

#include <time.h>

#include <string>

using namespace std;

int main(){

srand(time(NULL));

cout<<"Throw dice"<<endl;

int b =0;

int a=0;

a=rand()%6;

b=rand()%6;

for (int i =0;i<1;i++)

{cout<<"dice one: "<<a<<endl;}

for (int i =0;i<1;i++)

{cout<<"dice two: "<<b<<endl;}

if(a>b)

{cout<<"first dice won"<<endl;}

if(b>a)

{cout<<"second dice won"<<endl;}

else{cout<<"they are same"<<endl;

return main();

}

return 0;

}

Explanation:

/*maybe it help you it is almost done*/

You might be interested in
The customer's endpoint device on the wan is called the __________________.​
Lelu [443]
<span>The customer's endpoint device on the WAN is called the Data Terminal Equipment (DTA).
WAN 
is wide area network, referring to a network that extends over a large area. DTA is an end instrument which converts information into signals.</span>
3 0
3 years ago
When do we use an if- statement ​
wel

Answer:

You'd use an if statement if something happens. What I mean is that {If this happens} Then that happens but if the if doesnt happen then the then doesnt happen

Explanation:

3 0
3 years ago
Read 2 more answers
Myra just got the latest computer game and wants to play it on her desktop. When she plays the game, she notices that it is slug
diamong [38]

Answer:

Ram/cpu/gpu... Many many things she can do

Explanation:

It may be a issue of internet bandwith, if this new game requires a insane ammount of internet then it may run low FPS (frames per second) and make myra's game look slughish,but anouther issue may be the ram or cpu, like if this is a new game and you've always played like simple games, so your running on persay a core i3 or i4, it aint gonna cut it on a newer game, you gonna need a probably core i5 or i7, or be like any sane person and switch to amd, it may be a bit pricy but if you want nice clean gaming, then amd is the way to go

Also while you are at it get a ssd

I hope this helps "-"

8 0
2 years ago
Read 2 more answers
What symbol is used for an assignment statement in a flowchart?
Annette [7]

Answer:

processing

Explanation:

The flow chart is a diagram that shows the activity of the program, peoples or things.

Flowchart symbol and meaning in the options:

1. Processing: it is a rectangular shape block which is used for variable declaration or assignment.

2. I/0: it is a parallelogram in shape which is used for input or output.

3. Parallelogram: it is used for input or output.

4. diamond: it is used for decisions or conditions.

Therefore, the correct option is a. Processing is the one that is used for the assignment statement.

3 0
3 years ago
Consider the following method, remDups, which is intended to remove duplicate consecutive elements from nums, an ArrayList of in
MAXImum [283]

Answer:

B. {1, 2, 2, 3, 3, 4, 5}

Explanation:

Given

The above code segment

Required

Determine which list does not work

The list that didn't work is B.\ \{1, 2, 2, 3, 3, 4, 5\}

Considering options (A) to (E), we notice that only list B has consecutive duplicate numbers i.e. 2,2 and 3,3

All other list do not have consecutive duplicate numbers

Option B can be represented as:

nums[0] = 1

nums[1] = 2

nums[2] = 2

nums[3] = 3

nums[4] = 3

nums[5] = 4

nums[6] = 5

if (nums.get(j).equals(nums.get(j + 1)))

The above if condition checks for duplicate numbers.

In (B), when the elements at index 1 and 2 (i.e. 2 and 2) are compared, one of the 2's is removed and the Arraylist becomes:

nums[0] = 1

nums[1] = 2

nums[2] = 3

nums[3] = 3

nums[4] = 4

nums[5] = 5

The next comparison is: index 3 and 4. Meaning that comparison of index 2 and 3 has been skipped.

<em>This is so because of the way the if statement is constructed.</em>

3 0
3 years ago
Other questions:
  • Which of the following sentences uses the correct verb tense?
    8·2 answers
  • I am sorting data that is stored over a network connection. Based on the properties of that connection, it is extremely expensiv
    14·1 answer
  • what would be the address of the cell, which is intersect of the second row and third column in a worksheet
    8·2 answers
  • Clearing the computer's cache helps store recently-used information.
    8·1 answer
  • A file name extension provides what information about a file?
    6·1 answer
  • Global address list characteristics
    11·1 answer
  • Write a function endpoints that takes a list of numbers (eg. [5, 10, 15, 20, 25]) and returns a new list of only the first and l
    15·1 answer
  • Brain for free 12628397
    14·2 answers
  • 1.What is the output of the following program? [10 Marks]namespace ConsoleApp1{class Program{static void Main(string[] args){int
    13·1 answer
  • In addition to good design sense, what else do web designers need to be proficient in?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!