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
LAN security policies center on issues concerning connectivity; this includes determining how devices adhere to the network. Amo
ANTONII [103]

Answer:

<h2> Controlled maintenance and  configuration change control.</h2>

Explanation:

Among the types of LAN control standards are <em><u>controlled maintenance,  </u></em>which creates the schedules on LAN- attached devices for scheduled preventtative and consisten maintenance, and  <em><u>configuration change control.</u></em>

4 0
4 years ago
My uh coding teacher would like the class to do little piggy with code.
Digiron [165]

Answer:

see picture below

Explanation:

I added a parameter to factor out the first bit of each sentence into a global variable. If you change for example 'pig' into 'monkey', all sentences will change.

4 0
3 years ago
Catastrophic injuries and illnesses account for two-thirds of total health care costs in the country of Gnut. The Gnuti governme
Vilka [71]

Answer:

In the country of Gnut

The universal health insurance program that is likely to better allow Gnuti citizens to smooth consumption is:

program Y that would pay only for catastrophic illnesses and injuries.

Explanation:

Program Y is a better option for Gnuti citizens to smooth consumption.  The reason is that catastrophic injuries and illnesses already account for two-thirds of the total health care costs in the country.  These injuries and illnesses cost more income variability to the citizens than other health care expenses.  With the government sponsoring program Y, the citizens will be insulated from consumption patterns caused by income variability.  Consumption smoothing creates the needed balance between spending and saving during the different life phases for the citizens of Gnut.

3 0
3 years ago
Universal Containers sells its products online using a system built on Force Sites. The orders are captured and processed in Sal
sveta [45]

Answer:

Use Outbound Messages to send customer data from Salesforce to the marketing system.

Use a middleware tool to pull customer data from Salesforce and push it to the marketing system on a daily basis

Use Apex callout to send customer data from Salesforce to the marketing system

Explanation:

The above points illustrates a mechanism for moving cutomer data to the marketing system efficiently.

3 0
4 years ago
What is a job that was created by automobiles
jasenka [17]

many jobs were created, such as, but not limited to, factory worker, inspector, etc.

8 0
3 years ago
Other questions:
  • Write a method void Print(int LastNumber, int numbersPerLine) that receives two integers
    15·1 answer
  • A ____ paragraph places the first character of a text line near the left border of a placeholder.
    14·1 answer
  • Jim has excellent oral and written communication skills. He enjoys public speaking and wants a job in which he will interact wit
    10·2 answers
  • Assuming that a year has 365 days, write a class named DayOfYear that takes an integer representing a day of the year and transl
    6·1 answer
  • Describe three types of physical storage currently used. what usage scenarios would be ideal for each?
    7·1 answer
  • Compose one paragraph (three to four sentences) explaining the difference between a courtesy copy and a blind courtesy copy (thi
    9·1 answer
  • Flowcharts allow you to more easily clarify among multiple potential solutions to a problem to see which solution is best.
    5·1 answer
  • You want to copy data from one cell or range to an adjacent cell or range in your spreadsheet, without using a shortcut key. Whi
    10·1 answer
  • Henry is planning to visit Spain for a vacation. He wants to learn Spanish, but he prefers to do it in a fun way. He searches on
    8·2 answers
  • Macro mode is used to take landscape photographs of subjects fairly far from the camera.
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!