programming

Write a program that plays a simple dice game between the computer and the user. It uses an unusual dice that has 12 sides, with numbers that start from 10. When the program runs, a loop should repeat 5 times. Each iteration of the loop should do the following: o Generate a random integer in the range of 10 through 21. This is the value of the computer’s die. o Generate another random integer in the range of 10 through 21. This is the value of the user’s die. o The die with the highest value wins. (In case of a tie, you can randomly decide who wins.)
As the loop iterates, the program should keep count of the number of times the computer wins, and the number of times that the user wins. After the loop performs all of its iterations, the program should display who was the grand winner, the computer or the user.

  1. 👍 0
  2. 👎 0
  3. 👁 161

Respond to this Question

First Name

Your Response

Similar Questions

  1. Programming

    Write a pseudocode to represent the logic of a program that allows a user to enter an hourly pay rate and hours worked. The program outputs the user's gross pay

    asked by Sunshine on April 17, 2019
  2. C++

    // Program: name of program // Author: your name // Date Written: date you began writing the program /* Abstract: Brief description of the program */ Include in-line comments in the body of your program. You can convert

    asked by Frank on September 23, 2016
  3. Career Exploration

    Information Technology Quiz 1. Computer user support is another name for: a. customer service b. technical support*** c. network support d. information security 2. Digital designers need what kind of skills? a. network

    asked by ChichipoTae on April 12, 2019
  4. Mathematics for Liberal Arts

    You are on a TV show. You have been asked to either play a dice game five times or accept a $50 bill. The dice game works like this: If you roll a 1, 2 or 3, you win $46. If you roll a 4 or 5, you lose $22. If you roll a 6, you

    asked by Sandra on November 20, 2009
  5. java programming

    Dice Game Write a program that plays a simple dice game between the computer and the user. When the program runs, a loop should repeat 10 times. Each iteration of the loop should do the following: Generate a random integer in the

    asked by anonymous on May 28, 2020
  1. java programming

    1. Time Calculator Write a program that asks the user to enter a number of seconds. • There are 60 seconds in a minute. If the number of seconds entered by the user is greater than or equal to 60, the program should display the

    asked by ignatius on April 28, 2016
  2. CIS

    Draw a flowchart or write pseudocode to represent the logic of a program that allows the user to enter a value. The program multiplies the value by 10 and outputs the result.

    asked by Sonya on October 11, 2012
  3. Computer Science/Pseudo Code Python

    Hi, I'm confused about an assignment. I'm not sure what to do and would like some help. An example: Write a program that obtains two integer numbers from the user. It will print out the sum of those numbers. Pseudo code: Prompt

    asked by Rain on February 28, 2016
  4. Programming

    Draw a flowchart or write pseudo code to represent the logic of a program that allows the user to enter values for the current year and the user’s birth year. The program outputs the age of the user this year. Preferably a

    asked by Siya on December 3, 2019
  5. English

    1. I go to Russia often. 2. That computer is fixed. 3. We go to any moive that plays there. 4. All of you chase that bus every morning! 5. Jason turned out the lights. Rewrite each sentence in simple furture tense. 1. I will go to

    asked by Hayden on October 19, 2015

You can view more similar questions or ask a new question.