Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use C# here is what I got: namespace ConsoleApp1 { class Program { static void Main(string[] args) { Console.WriteLine(Hey! Welcome to Tina's Dice Game.); Console.WriteLine(Let's

Use C# image text in transcribed

here is what I got:

namespace ConsoleApp1 { class Program { static void Main(string[] args) { Console.WriteLine("Hey! Welcome to Tina's Dice Game."); Console.WriteLine("Let's start!"); Console.WriteLine();

int count = 1; int Dice1; // variables int Dice2; // variables Random random = new Random(); // set up a random number Dice1 = random.Next(1, 7); // random number from 1 to 6 Dice2 = random.Next(1, 7); // random number from 1 to 6

Console.WriteLine("I got " + Dice1 + " and " + Dice2 + "!");

if ((Dice1 + Dice2) % 2 != 0) // if the numbers are odd { Console.WriteLine("Odd are still cool!"); } else // if the numbers are not odd { Console.WriteLine("Evens are better than odds!"); } Console.WriteLine("Do you want to play again?"); String answer = Console.ReadLine();

while (answer == "YES") {

} } }

}

Hey! Welcome to Tina's Dice Game Let's start! Hey! Welcome to Tina's Dice Game Let's start! Dice 1 = 4 Dice 2 = 2 Dice 1 = 1 Dice 2 = 3 I got 4 and 2! Evens are better than odds! I got 1 and 3! Evens are better than odds! The Task: Do you want to play again? YES Do you want to play again? YES I want to play a game: Dice 1 = 3 Dice 2 = 3 Dice 1 = 5 Dice 2 = 2 I got 3 and 3! Evens are better than odds! I got 5 and 2! Odds are still cool! Do you want to play again? YES The number of times the dice was thrown is: 2 Nice game! Thanks for playing, Come play again soon! Dice 1 = 3 Dice 2 = 2 I have 2 die. 6 sided each I start the game and print the intro o "Hey! Welcome to Tina's Dice Game." O "Let's start!" The computer randomly generates what side of the die is chosen (for each die) I then add both of the random numbers together y I then print o Dice 1 = (the random number I got) o Dice 2 = (the random number I got) Depending on what number I get, something different is printed to the screen o If I get an even number . I print "I got (value of dice 1) and (value of dice 2)!" I print "Evens are better than odds!" o If I get an odd number . I print "I got (value of dice 1) and (value of dice 2)!" . I print "Odds are still cool!" At the end, I ask the user if they want to play again o If the answer is "YES" . I "throw the die again and repeat the printing process o If the answer is anything but YES (case-sensitive) . I end the game and print the outro o "The number of times the dice was thrown is: (value of times dice is thrown)" o Nice game!" o "Thanks for playing, Come play again soon!" I got 3 and 2! Odds are still cool! Hey! Welcome to Tina's Dice Game Let's start! Do you want to play again? YES Dice 1 = 5 Dice 2 = 6 Dice 1 = 4 Dice 2 = 5 I got 5 and 6! Odds are still cool! I got 4 and 5! Odds are still cool! Do you want to play again? Nah Do you want to play again? Whhhh... I am not really interested anymore What You Need to Do: The number of times the dice was thrown is: 1 Nice game! Thanks for playing, Come play again soon! The number of times the dice was thrown is: 4 Nice game! Thanks for playing, Come play again soon! Implement the code so that the output produced follows as below: I have included a few examples: age 2 of 3 557 words English (United States) -- - + 1009

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Joe Celkos Data And Databases Concepts In Practice

Authors: Joe Celko

1st Edition

1558604324, 978-1558604322

More Books

Students also viewed these Databases questions