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
Alex17521 [72]
2 years ago
6

Write a program in c# that simulates the roll of two six sided dice.

Computers and Technology
1 answer:
ruslelena [56]2 years ago
5 0

Answer:

using System;

class Program

{

   public static void Main(string[] args)

   {

       Random rnd = new Random();

       int tries = 0;

       while (true)

       {

           tries++;

           Console.Write("What do you think the total of two six-sided die will be? ");

           int guess = int.Parse(Console.ReadLine());

           int total = rnd.Next(1, 7) + rnd.Next(1, 7);

           Console.Write($"The total was {total}. ");

           if (total == guess)

           {

               Console.WriteLine($"Congratulations! It took you {tries} tries to guess successfully.");

               break;

           }

           else

           {

               Console.WriteLine("Try again!");

           }

       }

   }

}

Explanation:

Worst case you could be guessing forever...

You might be interested in
The range A2:B4 has how many cells?<br><br> Answers:<br> 2,4,6,8
mylen [45]
6 cells because you have to drag and it becomes six cells .

8 0
3 years ago
Read 2 more answers
How does the author of let bindi have the limelight persuade readers to consider the importance of wildlife conservation
kvasek [131]

Answer:

The answer is animal extinction.

Explanation:

Bind is considered to be an animal ambassador. The death of her father made her want to dedicate her career to animal conservation. She takes action, through business and performing to help conservation causes.

4 0
3 years ago
Read 2 more answers
Which of these is an application? Microsoft Windows Linux Microsoft Word Apple ios​
STALIN [3.7K]

Answer:

I think it's Microsoft windows

8 0
4 years ago
Read 2 more answers
Derek found that the CPU was running several processes. While Derek was looking at Task Manager, the computer crashed. Derek res
wlad13 [49]

Answer: d. Run a virus scan

Explanation: Running a virus scan will reveal if the trojan virus or any other malware has been launched and the clearing the virus when detected. These will make the computer to start working well again. The unexplainable processes that started when the computer was rebooted can be viruses.

8 0
4 years ago
Read 2 more answers
A mnemonic is a tool that you can use when you are studying to help you do which of the following?
hichkok12 [17]
The answer is a. A mnemonic is a tool to aid retention
5 0
3 years ago
Read 2 more answers
Other questions:
  • ______ is the software that blocks a user from being able to access your computer.
    9·1 answer
  • Checking account A charges a monthly service fee of $2 and a per-check fee of $0.30, while checking account B charges a monthly
    10·2 answers
  • When the wires are connected to the terminals of the battery, what causes electric current in the circuit?
    15·1 answer
  • Why is investing in a mutual fund less risky than investing in a particular company's stock? A. Mutual funds only invest in blue
    14·2 answers
  • Which of the following is considered a white collar crime?
    13·1 answer
  • What is the advantage of processor affinity on SMP computers ?
    14·1 answer
  • What is the force that resists the motion of an object through a fluid?
    6·1 answer
  • Why internet is helpful for ICT?​
    13·1 answer
  • 15 _____ 3 = 0 Question 11 options: a) / b) % c) * d) //
    12·1 answer
  • Refer to Table 8-4. Consider the data above (in billions of dollars) for an economy: Gross domestic product (in billions of doll
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!