You are working on a program that simulates a board game. On your turn, you roll two dice to move forward. If you roll the same number on both dice, the next player only rolls one die on their next turn, but if you roll two 3's you don't move forward and your next turn gets skipped. You wrote the following function to handle the rolls. When you get the return value, you know a -1 means the other player loses a die on their next roll, and any other return value is added to your current position. What is wrong with the function and how should you fix it? Select all that apply. def process_roll(roll1, roll2): if rolll == 3 and roll2 == 3: print ("You get skipped! Lose your next turn. :(") if rolll == roll2: print("Your opponent loses a die on their next turn !") return -1 return rolll + roll2 roll2 should have a default value of 1 so the function won't crash when you only roll 1 die. O You need to return 0 when you roll two 3's. O You need to return -1 when you roll two 3's so it doesn't move you forward 6.
Q: 1. Create a console program that will perform the following: Ask the user to enter the pieces of app...
A: Given :- Create a console program that will perform the followingAsk the user to enter the pieces of...
Q: A = {x E Z| - 1000 < x < 1000} Which choice below gives the value of Σ ========= ===== === 1000(1001...
A: - We have to get the summation value in tge range of -1000 and 1000. The value x is defined as z whi...
Q: The code has to be in C++, You are to use the started code provided with QUEUE Container Adapter...
A: Here is the solution with an output:-
Q: A literal integer is... O Text like "hello" or "enter a number" O A value that we can never be certa...
A: We can best use ints and floats for .... Answer : Numerical values Int and floats data types use fo...
Q: Brief information about matlab software
A: MATLAB software is a high level language software which is used for the object oriented programming....
Q: Describe what Object-Oriented Programming is.
A: Describe what Object-Oriented Programming is.
Q: A breakdown in communication between users and designers may jeopardise the success of a project.
A: Introduction: Communication failure occurs when the recipient has the wrong impression. Managers are...
Q: Lab Goal : This lab was designed to teach you how to use an array. Lab Description : Take a list of ...
A: Given :- Lab Goal : This lab was designed to teach you how to use an array.Lab Description : Take a ...
Q: Identify the basic business processes included within the scope of product lifecycle management.
A: -Product lifecycle management (PLM) is the process of managing the life cycle of products, services,...
Q: Following the development and testing of individual software modules, they must be combined and test...
A: Introduction: Software development refers to computer programming, which is the process of writing a...
Q: Define and describe virtual memory in computing in a few sentences.
A: Virtual memory is a memory management approach that allows secondary memory to be utilized in the sa...
Q: A variable is... O A value that we can never be certain of the value of before we check it A named "...
A: Here, we are going to answer both Python question which is related to basic Python theory. What is v...
Q: Why are "cookies" not seen as a violation of privacy?
A: As per company guidelines we are suppose to answer only 1 question. Kindly re-post other question...
Q: Give an explanation for your response. Is this statement true or false? - Regular member functions a...
A: Introduction: A virtual function is a base class member function that is overridden by the derived c...
Q: A 32-bit signed integer may be stored in which data type?
A: A 32-bit that means 4 bytes singed integer can be store the following way. This differs programming ...
Q: Using the following Relational database Schema write queries to retrieve the specified information. ...
A: here i write simple query to retrieve all tuples from song table: ==================================...
Q: How can i find the octal number from the user inputted decimal number. In ct
A: Lets see the solution.
Q: Compare the advantages and disadvantages of connectionless protocols to those that require a connect...
A: Introduction: A connectionless protocol demonstrates communication between two business endpoints in...
Q: What was the second phase of software engineering lifecycle? evaluation O planning/specification des...
A: As you can see the diagram below Let's discuss Software development lifecycle model phases:- 1) Pla...
Q: Read the article from RealPython regarding f-strings and answer the following question https://real...
A: According to company guidelines,we are instructed to answer only 3 parts of a question, please post ...
Q: Question#4: Consider a file system that uses inodes to represent files. Disk blocks are 8 KB in size...
A: answer is
Q: 15) Let M be the language over {a, b, c, d, e, f} accepting all strings so that: 1. There are precis...
A:
Q: Write a NumPy program to count the number of days of a given month for the given years import numpy ...
A: Here I have used a function named datetime64(). This function datetime64(), is present in the NumPy....
Q: She fine right?
A: Najenda Akame ga Kill
Q: Why are watchdog timers required in such a large number of embedded systems?
A: Introduction: When a microprocessor or microcontroller is used in an embedded system, it refers to a...
Q: What skills are needed for predictive modelling?
A: Introduction: Predictive analytics use analytics approaches to analyse historical and present data i...
Q: Calculate the number of subnets for each given Network Address and broadcast address and valid host ...
A: Calculate the number of subnets for each given Network Address and broadcast address and valid host ...
Q: Question1: - illustrate what is Iterative and Incremental Development? Why is iterative and incremen...
A: Iterative and Incremental development and it's importance: Iterative model means refining the softwa...
Q: Write a Python program that does the following Asks the user to enter the order. If the order is gr...
A: I have written the code as per all the requirement: I am attaching screenshots for both Do you want ...
Q: What Are the Most Common Errors That Can Occur in Data Modeling?
A: Introduction: Inappropriate denormalization: This method should be utilized only when absolutely ess...
Q: 4) Built a Binary Search Tree with the following integers given in order: 14 17 9 7 11 16 19 5 18 20...
A: note- as per guideline we will do only three part. a. compute height of obtained tree. b.is obtained...
Q: Network maintenance is an important task in organizations today who entirely rely on their network i...
A: In the third раrty mаintenаnсe (TРM) industry, netwоrk mаintenаnсe is essentiаlly whаt y...
Q: AI Question: Complete the following definition of a "draw" node: 1. A terminal node that represe...
A: 2. Draw node contains B-spile shape, film grains, sparkles and there are other vector related images...
Q: Brief information about matlab software
A: Answer :
Q: What distinguishes BIOS-level input/output from other types of input/output?
A: BIOS-level input/output is not directly to the CPU's memory, it is performed within an area of syste...
Q: A) Application Areas of Al includes Mundane tasks, Formal tasks and Expert tasks. Define and provide...
A: A) Introduction: Application areas of AI: The AI has three main domains where the use of AI is benef...
Q: Create a PhoneListing class that uses the Name class for one of its instance variables. Remember the...
A: The code for the classes Name and PhoneListing is given below: class Name implements Comparable<N...
Q: Read the article and answer the following question in your own word Artist’s link: https://timo...
A: According to the information given:- We ahve to define ASCII , Unicode, Code point,Unicode sandwich ...
Q: Brie and I are talking about evaluating emanic rules in syntax-directed definin. 1009 44 ENG IN 1/1 ...
A: Intro Semantic rules of syntax-directed translation are basically evaluated in order to calculate th...
Q: Discuss various security and privacy issues related with various levels of IoT solutions for health ...
A: Introduction: The Internet of Things (IoT) is a network of physical objects—"things"—embedded with s...
Q: What does the term "spool" refer to when printing anything on paper?
A: INTRODUCTION: Printer spooling allows you to send many big document files to a printer without havi...
Q: Sparky's Fun Park is an entertainment park run by recent ASU graduates. It caters to young people an...
A: REA Data Model: REA data model is used to design Automatic information system (AIS) databases ,REA ...
Q: ython: I am trying to write a simple GUI based program with two input fields “Directory/filename” an...
A: Dictionary in Python is Associate in Nursing unordered assortment of information values, accustomed ...
Q: Give an example of how the read-committed isolation level prevents schedules from causing a cascade ...
A: Given :- Give an example of how the read-committed isolation level prevents schedules from causing a...
Q: Write a NumPy program to combine last element with first element of two given ndarray with different...
A: The Missing code will be: result = np.r_[array1[:-1], [array1[-1]+array2[0]], array2[1:]]
Q: specify virtual memory
A: Intro Virtual memory, in context with computing, is memory management technique that is used by the ...
Q: Mr. Ali deposits an amount x in a Bank. The bank gives an annual interest of 6% and also charges a m...
A: Write a Python program to input the amount x(in $) from the user and print the final amount present ...
Q: Consider the following relations for a database that keeps track of auto sales in a car dealership (...
A:
Q: a. What is 2PC? b. In what two ways could 2PC fail?
A: 2PC is related to the database so let's talk about it: DATABASE A database is a logically ordered co...
Q: A rotation cipher is one of the simplest, plain-text ciphers, known since at least the time of Juliu...
A: # define variables keep_going = True alphabet = 'abcdefghijklmnopqrstuvwxyz' while keep_going != Fa...
Step by step
Solved in 4 steps
- We want to develop a game where the user should guess a secret number. The game asks the user to input a number and tells how close it is to the secret random number that the game generates. Complete the main() function that implements this game by calling the get_user_input(), generate_secret(), and display_result(user_input, secret) functions that you will develop as follows: • Complete the get_user_input() function so that it prompts the user to enter a whole number between 1 and 20 (inclusive) and returns the number that the user enters. • Complete the generate_secret() function so that it generates and returns a random number between 1 and 20 (inclusive). Complete the display_result(user_input, secret) function that takes the two parameters that correspond to the user input and the secret. It should then print the absolute difference between these two numbers. For example: Test Input Result random.seed (10) 5 random.seed(50) 6 Enter a number from 1 to 2015 You entered 5. The…In Python Text-based adventure game: Pretend you are creating a text-based adventure game. At different points in the game, you want the user to select to fight, run, or hide from certain enemies. The selection variable must be sent as an argument into the choice() function. The user should enter 1 to fight, 2 to run, or 3 to hide in the main(). The choice() function should print one of the three options. Add an if statement in the choice() function to make the correct selection.A non-profit organization has asked you to build a computer programming system thatkeeps up with the number of hours a volunteer has worked each week.Since no volunteer will work more than three days, the organization wants the volunteersto be able to enter their name and the hours volunteered for each of the three days theycame in each week.The program will also make sure that the data entered is valid. The program will make surethe hours entered are a positive number and that the hours are no more than 8 hours eachday. If the volunteer enters an invalid number of hours, then the program will ask them tore-enter the value and repeat the data entry process.You can follow these steps to guide you through the process:1. Create a public class named Volunteer and one named VolunteerEntry.2. The Volunteer class will contain instance variables for each object to hold datapertaining to each object as needed. It will store the values for the volunteer’s name, IDand total hours worked for the…
- Design and implement an application that plays the High-Low guessing game with numbers. The program should pick a random number between 1 and 100 (inclusive) then repeatedly prompt the user to guess the number. Every time the user guess, inform him/her whether the guess is correct, or the guess is high or low.Continue accepting guesses until the user guesses correctly or chooses to surrender. Use a sentinel value to determine whether the user wants to quit. Count the number of guesses and display that value when the user guesses correctly. At the end of each game (either by quitting or a correct guess) prompt to determine whether the user wants to play again. Continue playing until the user chooses to stop. When the user stops playing, display the number of correct guesses and surrenders.The c++program should use suitable selection and repetition structures. The input process, guessing process and output must be organized into appropriate functions.Design and implement an application that plays the Hi-Lo guessing game with numbers. The program should pick a random number between 1 and 100 (inclusive) and then repeatedly prompt the user to guess the number. On each guess, report to the user that he or she is correct or that the guess is high or low. Continue accepting guesses until the user guesses correctly or chooses to quit. Use a sentinel value to determine whether the user wants to quit. Count the number of guesses, and report that value when the user guesses correctly. At the end of each game (by quitting or a correct guess), prompt to determine whether the user wants to play again. Continue playing games until the user chooses to stop.Python Your first assignment is to help test the “red mushroom” power-up. This power-up provides a speed boost to the player for a limited time. The team wants to be able to easily test different speed values to find the one that is the most fun. Your task is to write the function calculate_boost_distance(speed, time). This function takes an integer value for speed representing the miles per hour of the kart and a floating point value time that represents the number of seconds the boost will last. It returns a floating point number representing the speed multiplied by the time. Sample usage of the completed function: Full explain this question and text typing work only
- Reza Enterprises sells tickets for buses, tours, and other travel services. Because Reza frequently mistypes long ticket numbers, Reza Enterprises has asked his students to write an application that shows if a ticket is invalid. Your application/program tellsthe ticket agent to enter a six-digit ticket number. Ticket numbers are designed so that if you lose the last digit of the number, then divide by 7, the remainder of the division is exactly the same to the last dropped digit. This process is shown below: Step 1: Enter the ticket number; for example 123454 Step 2: Remove the last digit, leaving 12345 Step 3: Determine the remainder when the ticket number from step 2 is divided by 7. In this case, 12345 divided by 7 leaves a remainder of 4. Step 4: Display a message to the ticket agent indicating whether the ticket number is valid or not.. Test your application with the following ticket numbers: - 123454; is a valid ticket number - 147103; is a valid ticket number -…I have an assignment that needs to be turn in before monday, here's the question: Two people play the game of Count 21 by taking turns entering a 1, 2, or 3, which is added to a running total. The player who adds the value that makes the total reach or exceed 21 loses the game. Create a game of Count 21 in which a player competes against the computer, and program a strategy that always allows the computer to win. On any turn, if the player enters a value other than 1, 2, or 3, force the player to reenter the value. Save the game as Count21.java. Here's the code that I'm working on: import java.util.Scanner;public class Count21 {public static void main(String[] args) {// Scanner object to get user inputScanner scanner = new Scanner(System.in);// Stores the running total. //Displays a welcome for the user public void promptEnterKey(){System.out.println("Welcome to Count21! \n");System.out.println("Press \"ENTER\" to continue...");Scanner scanner = new…Using C++ Dice game with varying dice (d4-d20) The game will consist of two or more players. Each player will attempt to reach a set number (say 100) By rolling dice and adding up the results of the dice roll. if the player rolls a certain number (in this case a 6) then the player gets two more tries, if they roll a 6 two more times, they lose their turn and gain no points that round. The goal to get to 100 first. During a round, each player takes a turn. At the beginning of the game, each player rolls a dice, with the higher roll going first each round. A player’s total score is the sum of their turn scores, the users will have the ability to choose either to stop or to continue after first roll, if a player decides to stop, then their turn ends and their score for that turn is their maximum roll during that turn, if the player decides to continue, they roll the dice again. At the end of the game the program should display the winner your program should have at least four of…
- The local taqueria now wants some help with their kitchen system. There are four types of burritos: carnitas, beef, shrimp, and vegetarian. They would like you to create a program to send an alert to the kitchen if there is a shrimp burrito in a given order. Your main() function should prompt the user for the number of burritos in the order, and then enter all the burrito types for the order. The burrito types should be stored in an array of strings. You'll also need to store the number of burritos in the order. You can assume that no order will have more than 10 burritos. You can assume that the user only types in valid types of burritos, e.g. carnitas, beef, shrimp, vegetarian. The shrimp burrito must be cooked to order and thus takes longer to prepare than the other kinds. Because of this, an alert is needed ASAP if there is a shrimp burrito in the order. Write a function which takes two parameters: your array of burrito strings, and the number of burritos in the array.…Using C++ How would I generate a random value for a random location in a multiplication table (printing the random value at a random row and column). Then you ask and read a row and column from the user and compare them with the generated row and column and tell if it’s right. We haven't learned functions. Just nested Loops Assignment: Write a program that prints the multiplication table but inserts a randomly generated incorrect value between 1 and 50 into a cell whose row and column are randomly selected. Make sure the program does insert an incorrect value. For example, if row and column of 3 and 4 are randomly selected, keep generating a random number to print for that location until it's not the right value of 12. Then, ask the user to tell where in the table the incorrect number is located by entering the row and column of the incorrect number. Print whether the user was right or not. If he or she was right, ask for and read the correct value; if not, the program must give the…Can you add a dodamage function to the code? There are options that cause the player to lose lives. We're going to introduce the concept of player health. When the game starts, the player health should be 100. Rather than take an entire life, we want to do damage to the players health and take a life if their health falls below 100. This function should take the players current health as an argument, calculate the new health and return it to the caller. You can choose the amount of damage that is done. *Existing code is below and don't use HTML* const prompt = require("prompt-sync")(); var adventurersName = ["Captain Thomas King","George","Tim","Sarah","Mike","Edward",];var len = 0;var Inventory = new Array(5).fill(" ");Inventory[len++] = "Food";Inventory[len++] = "Wine";Inventory[len++] = "Horses";Inventory[len++] = "Medicine"; var adventurersKilled = 3;var survivors;var numberOfAdventurers = adventurersName.length; survivors = numberOfAdventurers - adventurersKilled;…