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
A customer is experiencing intervals during the day when the file server on her local network cannot keep up with the demands of
levacccp [35]

Answer: Contact the manufacturer and asks for another filter driver device.

Explanation:This issue can occur if a non-Microsoft program installed on your computer uses an outdated kernel-mode filter driver. And it can be that kernel-mode filter driver may be outdated.

3 0
4 years ago
What is the answer of this Q?
Inga [223]

Answer:

Because of refraction.

Explanation:

Light coming from fish passes through two medium, one is water and another is air. As the density of medium is changing from high to low, the light bends away from the normal. So to the human eyes, the fish appears to be above its actual position.

7 0
3 years ago
Read 2 more answers
Important of microcomputer in some point​
Sedbober [7]

Answer:

A microcomputer uses memory to store the programs that control its operation, to store data waiting for processing, and to store the results of operations performed by the CPU. Primary memory, or storage, is electronic memory that is directly addressable by the CPU.

Explanation:

brainliest plzzzzzzz

8 0
3 years ago
Read 2 more answers
A terrestrial biome is named according to the _____ in which a group of plants and animals occur together.
ikadub [295]

Answer:

Predominate Vegetation

Explanation:

3 0
4 years ago
You are the information security officer at a medium-sized company (1,500 employees). the cio asks you to explain why you believ
Ivahew [28]
If your CIO asks such a stupid question run for the hill, he should not hold that title.
Every company, small, medium or large should have Firewalls, Intrusion Detection, Managed Virus Protection Software at the very least. Windows is the most deployed OS in the world and of course the main target of hackers i.e Viruses. MAC's to a lesser extent and Unix while probably the least vulnerable are still not immune to Viruses/Trojan and other Malware.

Users can still be the victims of trojan horses, phishing scams, and other online fraud. There<span> is no such thing as a 100% safe computer, a </span>Mac<span>, Windows, and even Linux are all capable of being infected with a </span>virus<span> or other malware.
</span>
Lastly, physical access to any computer that is not encrypted is vulnerable.
5 0
3 years ago
Other questions:
  • Some might consider careers in the Construction industry to be quite flexible. Which statement supports this claim? Employees ca
    14·2 answers
  • A(n) ____ is a system designed to handle only very basic applications with an absolute minimum amount of hardware required by th
    9·1 answer
  • Spreadsheet software creates a ____, composed of a grid of columns and rows
    6·1 answer
  • Which word most likely means "a timepiece fitted with a recording device that marks down exact intervals of time"? chronograph c
    9·2 answers
  • When naming a file to upload into an assignment in blackboard, it is okay to use special characters?
    13·1 answer
  • AW Computing uses a private sharing model for cases. A select group of five users need read/write access to all cases with a spe
    8·1 answer
  • For this project, you have to write 3 functions. C++
    13·1 answer
  • Compound conditions require a computer to sense whether multiple conditions are true or false.
    9·1 answer
  • What If smart phones / computers didn't exist? <br>​
    5·1 answer
  • PYTHON
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!