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
Wewaii [24]
3 years ago
15

Write a program which simulate rolling dice. When the program runs, it will prompt the user to choose a number ranging from 1 to

6. It will then randomly choose a number between 1 and 6. The program will print the message "Your guess is correct!" if the guess number equals to the dice number, otherwise it will print "Wow! The dice number is --.". It should then ask the user if you’d like to roll again. Enter "1" to roll again and enter "0" to end the game. Concepts to keep in mind:
Concepts to keep in mind:
• Random
• Integer
• Print
• While Loops

Output:
Enter your guess number between 1 and 6: 5
Wow! The dice number is 1
Do you want to dice it up again:Enter 1 and if not enter 01
Enter your guess number between 1 and 6: 4
Wow! The dice number is 1
Do you want to dice it up again:Enter 1 and if not enter 01

Computers and Technology
1 answer:
Arada [10]3 years ago
5 0

Answer:

Written in Python

import random

tryagain = 1

while tryagain == 1:

guess = int(input("Enter your guess number between 1 and 6: "))

num = random.randint(1,7)

if guess == num:

print("Your guess is correct")

else:

print("Wow, the dice number is "+str(num))

tryagain = int(input("Do you want to dice it up again:Enter 1 and if not enter 0: "))

Explanation:

I've added the full source code as an image attachment where I used comments to explain difficult lines

You might be interested in
Need help please asap
Nitella [24]

Answer:

Its C that is the answer hahahahha

6 0
3 years ago
epic poem - long narrative poem about heroic deeds about pharrell williams of the happy song please help i need the right answer
Naddik [55]

"Happy" is a song written, produced, and performed by American singer Pharrell Williams, released as the first and only single from the soundtrack album for the film Despicable Me 2 (2013). The song was first released on November 21, 2013, alongside a long-form music video. The song was reissued on December 16, 2013, by Back Lot Music under exclusive license to Columbia Records, a division of Sony Music.[1] The song also served as the lead single from Williams' second studio album, Girl (2014).

"Happy" is an uptempo soul and neo soul song on which Williams's falsetto voice has been compared to Curtis Mayfield by critics. The song has been highly successful, peaking at No. 1 in the United States, United Kingdom, Canada, Ireland, New Zealand, and 19 other countries. It was the best-selling song of 2014 in the United States with 6.45 million copies sold for the year,[3] as well as in the United Kingdom with 1.5 million copies sold for the year.[4] It reached No. 1 in the UK on a record-setting three separate occasions and became the most downloaded song of all time in the UK in September 2014;[5] it is the eighth highest-selling single of all time in the country.[6] It was nominated for an Academy Award for Best Original Song. A live rendition of the song won the Grammy Award for Best Pop Solo Performance at the 57th Annual Grammy Awards.

The music video for "Happy" was nominated for Best Male Video and Video of the Year at the 2014 MTV Video Music Awards. It also won the Grammy Award for Best Music Video at the 57th Annual Grammy Awards.[7][8] The song was Billboard's number-one single for 2014.

"Happy" was the most successful song of 2014, with 13.9 million units (sales plus equivalent streams) worldwide

7 0
3 years ago
Define a function compute_gas_volume that returns the volume of a gas given parameters pressure, temperature, and moles. Use
jeyben [28]

Question:

Define a function compute_gas_volume that returns the volume of a gas given parameters pressure, temperature, and moles. Use the gas equation PV = nRT, where P is pressure in Pascals, V is volume in cubic meters, n is number of moles, R is the gas constant 8.3144621 ( J / (mol*K)), and T is temperature in Kelvin.

Answer:

This solution is implemented in C++

double compute_gas_volume(double P, double T, double n){

   double V = 8.3144621 * n * T/P;

   return V;

}

Explanation:

This line defines the function, along with three parameters

double compute_gas_volume(double P, double T, double n){

This calculates the volume

   double V = 8.3144621 * n * T/P;

This returns the calculated volume

   return V;

}

To call the function  from the main, use:

<em>cout<<compute_gas_volume(P,T,n);</em>

<em />

<em>Where P, T and n are double variables and they must have been initialized</em>

5 0
3 years ago
When would you use an omnidirectional microphone?
alina1380 [7]

Answer:

when it is a windy day and you want to reduce the sound of the wind in the recording

5 0
3 years ago
Wyjaśnij w jaki sposób wykonuje się nitowanie zakładkowe i nakładkowe, oraz wyjaśnij na czym polega pasowanie mieszane.
Ksenya-84 [330]

Answer:

????

Explanation:

i dont speak this language

7 0
3 years ago
Other questions:
  • Consider a relation representing the present position of molecules in a closed container. The attributes are the ID for the mole
    12·1 answer
  • Windows on the desktop are just one of many objects used in a graphical user interface (GUI)-- buttons, drop-down list boxes, po
    7·1 answer
  • Which of the following software maintenance steps erases gaps caused by deleting files from the hard drive?
    10·1 answer
  • Implement a program that manages shapes. Implement a class named Shape with a method area() which returns the double value 0.0.
    15·1 answer
  • Write an algorithm and flowchart to calculate sum of two given numbers​
    13·1 answer
  • Have all of my coins because i will delete acount there will be part 2, 3 , 4 ,5,6,7,8
    15·2 answers
  • Write a method named lastIndexOf that accepts an array of integers and an * integer value as its parameters and returns the last
    15·1 answer
  • What legal protection would cover a person invention?
    10·2 answers
  • Hilarious error messages
    10·2 answers
  • 3) The director tells you to truck left, you must:
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!