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
musickatia [10]
3 years ago
10

21. Dice Game Write a program that plays a simple dice game between the computer and the user. When the program runs, a loop sho

uld repeat 10 times. Each iteration of the loop should do the following: • Generate a random integer in the range of 1 through 6. This is the value of the computer’s die. • Generate another random integer in the range of 1 through 6. This is the value of the user’s die. • The die with the highest value wins. (In case of a tie, there is no winner for that particular roll of the dice.) As the loop iterates, the program should keep count of the number of times the computer wins, and the number of times that the user wins. After the loop performs all of its iterations, the program should display who was the grand winner, the computer or the user.
Computers and Technology
1 answer:
Brrunno [24]3 years ago
5 0

Answer:

See Explanation Below

Explanation:

// Program is written in C++ programming language

//.. Comments are used for explanatory purposes

// Program starts here

#include<iostream>

#include <stdlib.h>

#include <time.h>

using namespace std;

int main()

{

int computerWins = 0, computerPlay = 0;

int userWins = 0, userPlay = 0;

int tiedGames = 0;

// Computer Play

for (int play = 0; play< 10; play++) {

   computerPlay = rolls();

   userPlay = rolls();  

   // Check who wins

//Clear Screen

System("CLS")

   if (computerPlay == userPlay) {

       tiedGames++;

cout<<"Ties........" + tiedGames;    }

else {

       if (computerPlay> userPlay) {

           computerWins++;

cout<<"Computer...."<< computerWins;

       } else {

           userWins++;

cout<<"User........"<< userWins;

      }

  }

}

return 0;

}

int rolls() {

srand((unsigned)time(0));

return rand() % 6 + 1;

}

You might be interested in
What is Dailymotion Cloud on the Dailymotion site?
lana [24]
C, a video solution that is adaptable to the users storage space
4 0
3 years ago
Read 2 more answers
Is the wireless network you own as secure as it should be? Examine your wireless network or that of a friend or neighbor and det
AleksandrR [38]

Answer:

See explaination

Explanation:

Wireless Security:

In a bid to examine the network you can use ipconfig /all command in windows or in the event where you are a linux user type in ifconfig to view all the configuration details of your network such as

indows IP Configuration

Host Name . . . . . . . . . . . . : myvpc-hb

Primary Dns Suffix . . . . . . . : example.com

Node Type . . . . . . . . . . . . : Hybrid

IP Routing Enabled. . . . . . . : Yes

Ethernet adapter Local Area Connection:- - - - - -

Connection-specific DNS Suffix . :- - - - - -

Description . . . . . . . . . . : Intel 68540-Based PCI Express Fast Ethernet Adapter

Physical Address. . . . . . . . . : 00-03-AA-BC-CA-8F

Autoconfiguration Enabled . . . . : Yes

Link-local IPv6 Address . . . . . : fe65::ab56:ccb9:320c:524d%8(Preferred)

IPv4 Address. . . . . . . . . . . : 192.168.45.111(Preferred)

Default Gateway . . . . . . . . . : 192.168.15.1

DHCP Server . . . . . . . . . . . : 192.168.15.1

DHCPv6 IAID . . . . . . . . . . . : 201327615

Note: If you want to deeply examine the your network and to find security model go with Wireshark application.It will help you to capture the data packets easily using GUI.Also it will provide other details like transmission control protocols,etc.

To take your network to highest level i.e. to make it more secure you can use:

1.Firewalls like application gateways,packet filtering,hybrid systems.

2.Crypto cable routers

3.Virtual private networks, etc.

Estimation of cost and the time to increase the level is solely depends on the type of the architecture you want to use for the network building structure.Also the size of the network will be responsible for the cost and time.

In case of any attack on your computer it depends on the size of the data on the computer disc and the bandwidth of the network to which your computer is connected to replace all data. The faster the bandwidth of the network,faster the data replacement rate.

3 0
2 years ago
If a node has a wireless connection to the internet, does that node have to be mobile
Marizza181 [45]
No it does not . answers
8 0
3 years ago
19) If you want to find your lowest paid, full time employee (with "FT" in column B and each employee's salary found in column C
Vadim26 [7]

Answer:

MAXIF

Explanation:

The MAXIF function is a function used in Ms Excel.

  • This function indicates the maximum value located on an array .

Option B

7 0
2 years ago
Read 2 more answers
true or false if you type too much text on a powerpoint slide, the additional text is added to a second slide
Nady [450]
True I've had it happen alot
3 0
3 years ago
Read 2 more answers
Other questions:
  • You're working at a large industrial plant and notice a tag similar to the one shown in the figure above. Which of the following
    9·2 answers
  • A short-circuit evaluation is where each part of an expression is evaluated only as far as necessary to determine whether the en
    14·1 answer
  • If you want to copy text formatting from one area of your document to another area, _____. a. select the formatting you would li
    5·1 answer
  • Dustin runs a command at the command line trying to find out what kernel version the system is running. However, it doesn't give
    12·1 answer
  • Windows _____ is a system notification utility and gives quick access to settings for items like screen brightness and network c
    8·1 answer
  • 2. a computer system designed to run games is called what?
    11·1 answer
  • Can someone tell me how this is a SyntaxError! (Python3)
    12·1 answer
  • What is the function of the NOS? Select all that apply.
    5·2 answers
  • Which tool allows users to share code and also serves as a social networking
    10·1 answer
  • WILL MARK BRAINLIEST WORTH ALOT OF POINTS! HELP ME GET THIS DONE
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!