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]
3 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]3 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
How do you print a document?
Monica [59]
Control + P (push these buttons at the same time)

or right click and print.

if you are printing a webpage, the steps are the same.

if you are using Word, then you just need to find the File tab and print should be in the list.
3 0
3 years ago
Question 5
OverLord2011 [107]

Answer:

The answer to this question is given below in the explanation section.

Explanation:

This is a Python function that generates random number between the given range. However, it includes the numbers that are given in the range.

So this function can generate a random number and return a number between 1 and 9 (inclusive 1 and 9).

The function is written below

...........................................................................................................

import random

print(random.randint(1, 9))

<em>#returns a number between 1 and 9 (both included)</em>

.....................................................................................................................

4 0
3 years ago
Select the correct answer. Arcade games such as Donkey Kong, Mr. Do! , and Venture were adapted from arcade titles to home conso
Andrew [12]

Answer:

D. Magnavox

hgjvyihbnjbuhklnk. hvgvjnm;lkbhkvkbl.

4 0
4 years ago
Name 3 coding languages
Pavlova-9 [17]

Answer:

javascript, python, c#

Explanation:

7 0
3 years ago
Read 2 more answers
Design a database suitable for a university registrar. This database should include information about students, departments, pro
zalisa [80]

Answer:

For designing a database suitable for a University registrar, the following information is included which are Information about Students, Information about Departments, Information about Professors, Information about courses, Student Grades,TA's for a course, Department offering different courses.

In creating the database registrar system the following values are defined such as Entity, Attributes of entities,The relationship among entities.

Explanation:

Solution

The following requirements are for designing of database for  a University registrar.

The Database Schema includes the following:

  • Information about Students
  • Information about Departments.
  • Information about Professors.
  • Information about courses.
  • Student Grades.
  • TA's for a course.
  • Department offering different courses.

Now,

For the design of Database for Registrar System we need to define the following:

(1)Entity: Student, Course, Instructor, Course offering.

(2) Attributes of Entities:

  • Student entity has Sid, name, program as its attributes
  • Course has Course_n, title, credits, and syllabus as its attributes
  • Instructor has iid ,name ,dept, title as its attributes
  • Course offering has section_no ,time, room, year,semester as its attributes

(3) Relationship among various entities:

  • Enrolls
  • Teaches
  • © is offered

Note: kindly find an attached copy of the E-R Diagram for University Registrar below, and his diagram shows student entity enrolls various courses which can be having teaches relationship with instructor. Course is being offered by relationship is offered by course offering.

5 0
3 years ago
Other questions:
  • In one to two sentences, explain how to save a new document.
    15·2 answers
  • Witch of the following is a valid why a scientist might a scientific theory
    13·1 answer
  • Which state legislation requires companies to report security breaches within 48 hours
    6·1 answer
  • Steve left his computer switched on in his room and went out to have breakfast. When he returned, he saw that the monitor had be
    9·1 answer
  • Historically, storytelling passed down the most important ideas about life, family, and society from generation to generation; t
    10·2 answers
  • Explain what the problems with the implementation of the function are, and show a way to fix them.// return true if two C string
    7·1 answer
  • What model involves the creation of data and process models during the development of an application
    14·1 answer
  • Can you defeat all 3 Daughters Of Lerion at a 98 power level in Assassin's Creed Valhalla? Its part of the mysteries column. whe
    11·2 answers
  • Which objects appear on the slide after she clicks ok? Check all that apply.
    5·2 answers
  • Directions: Give the shortcut key for the following commands: 1. Open 2. Save 3. New document 4. Copy 5. Undo 6. Redo 7. Paste 8
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!