13. PowerBall Lottery To play the PowerBall lottery, you buy a ticket that has five numbers in the range of 1-69, and a "PowerBall" number in the range of 1-26. (You can pick the numbers yourself, or you can let the ticket machine randomly pick them for you.) Then, on a specified date, a winning set of numbers is randomly selected by a machine. If vour first five numbers match the first five winning numbers in any order, and your PowerBall number matches the winning Pow- erBall number, then you win the jackpot, which is a very large amount of money. If your numbers match only some of the winning numbers, you win a lesser amount, depending on how many of the winning numbers you have matched.
Q: 1. [LO 1, LO 2, LO 3 & LO 4, Treasure Hunter Description You are in front of a cave that has…
A: Answer: I have done code and also I have attached code and code screenshot as well as output
Q: Q3. (Dice Rolling) Write a program that simulates the rolling of two dice. The program should use…
A: Given:
Q: 4. Area of a Rectangle • Write a program that compares the area of two rectangles. You can do this…
A: len_rect1 = float(input("Enter the length of first rectangle: ")) # taking the length of rect1…
Q: (PYTHON) A nutritionist who works for a fitness club helps members by evaluating their diets. As…
A: - We yave to help the nutritionist with the code.
Q: 3.17 (Game: scissor, rock, paper) Write a program that plays the popular scissor–rock–paper game.…
A: Answer :
Q: (Prism Program) Write a program that can calculate the value of the surface area and volume of a…
A: As Programming language is not mentioned, taking C as reference. Inputs : Lenght, Width and Height…
Q: Credit Card Number CheckThe last digit of a credit card number is the check digitwhich protects…
A: Note : I have used java programming language since it is not mentions which language to be used to…
Q: Alphabetic Telephone Number Translator Many companies use telephone numbers like 555-GET-FOOD so the…
A: Program: // Import the required packagesimport java.util.Scanner;import java.lang.String;// Class…
Q: 1- Get a number from user. 2- If the number is not divisible by 5 then find out how much more you…
A: Summary: In this question, we have to write a program in C++. In the program, we have to take a…
Q: Questioin: Hidden Secret Problem! In this problem, you are given two names, you have to find…
A: Program Plan: Enter the number of cases. Enter the two strings for each case. Convert both the…
Q: Bob takes medication three times a day. In the morning at 8:00, in the afternoon at 13:00, and in…
A: The Enum in C is a data type which contains a fixed set of constants. The enum constants are…
Q: Alphabetic Telephone Number Translator Many companies use telephone numbers like 555-GET-FOOD so the…
A: Python: It is one of the easiest programming language. It is a concise (less)code. It is a…
Q: (Comparing Integers) Write a program that prompts the user to enter the edges of a triangle and…
A: PROGRAM CODE: #include<iostream>using namespace std;int main(){ int side1, side2, side3; cout…
Q: Enter the number of days: Day Cents $ 0.01 2 $ 0.02 3 $ 0.04 4 $ 0.08 $ 0.16 $ 0.32 $ 0.64 $ 1.28 $…
A: Find Your Code Below
Q: Write a program that calculates your grade in this class based on weights for each category and…
A: Algorithm Start Recieve input score from user for reading assignment and assign it to a variable(…
Q: Dice game Rules of the game: The players roll three dice, and the program adds the sides that turn…
A: Coded using Python 3.
Q: Widgets and Gizmos An online retailer sells two products: widgets and gizmos. Each widget weighs 75…
A: code is given below:
Q: Magic Number Programming: Magic program ask user to enter three integers by the user, the three…
A: # include<stdio.h> void magic(int left, int right, int digit) // the function to generate…
Q: What is the output of the following code?
A: The ostream class is represented by the C++ cout expression. It's utilized to generate output for…
Q: **3.23 (Geometry: point in a rectangle?) Write a program that prompts the user to enter a point (x,…
A: C++ Program for above : #include <iostream> using namespace std; int main() { int…
Q: Travel Tickets Company sells tickets for airlines, tours, and other travel-related services. Because…
A: Required: write an application that indicates invalid ticket number entries. The class prompts a…
Q: Twin primes are a pair of prime numbers that differ by 2. Forexample, 3 and 5 are twin primes, 5 and…
A: Program: //include header file import java.util.Scanner; //definition of main class public class…
Q: PLEASE CODE IN PYTHON The Penny Pitch game is popular in amusement parks. Pennies are tossed onto a…
A: The code is written in python as follow as :
Q: Nice Number Programming: Nice program ask user to enter three integers from keyboard (java console),…
A: Below is the required java program. Program Approach: Import necessary packages to get the standard…
Q: 10) The assignment statement p = d; is legal even though p is not a Dog.
A: Please see the next step for solution
Q: The Fibonacci series is a series that begins with 0 and 1 and has the property that each succeeding…
A: PROGRAM CODE: #include <iostream> // include header file for input output stream…
Q: Mathletes Game! With the introduction of loops, we now know enough about programming to begin…
A: Please check the below c++ code
Q: Magie Number Programming: Magic program ask user to enter three integers by the user, the three…
A: Given: Magic program ask user to enter three integers by the user, the three integers represent left…
Q: Part D: Field Trip You only get to go on your field trip if you bring back a signed permission slip.…
A: Program Explanation: 1) Implement the header file. 2) Use an if-else statement. 3) Print the output.…
Q: Beautiful Strings Programming challenge description: When John was a little kid he didn't have much…
A: Actually, java is a object oriented programming language. It is a platform independent.
Q: Birthday party At Lili's birthday party, there was a game arranged by Jojo as the host. That game…
A: C++ Program for above : #include <bits/stdc++.h> using namespace std; int solve(int x,…
Q: 5. Alphabetic Telephone Number Translator Many companies use telephone numbers like 555-GET-FOOD so…
A: Python program code: a=input("Enter a telephone number XXX-XXX-XXXX: ") #user inputb=a.split('-')…
Q: 4.33 - (Perfect number) A positive integer is called a perfect number if it is equal to the sum of…
A: A perfect number is the sum of all the divisors less than n is equal to the n value then n is called…
Q: Write method IsEven that uses the remainder operator (%) to determine whether an integer is even.…
A: Program : import java.util.Scanner; public class Main { public static boolean isEven(int z){…
Q: onsider writing code that starts with the ima nage, resulting in the picture on the right be
A: var image=new Simpleimage("Chapel.png"); print(image);
Q: Python Assignment: In India McDonald's has the n number of customers and they are famous for their…
A: Required:
Q: PART 2) BRANCHING Write a quadratic equation solver. Ask the user to type in three numbers: a, b,…
A: Dear learner, hope you are doing well. I will try my best to answer this question. Thank You!!
Q: 24. Word Game Write a program that plays a word game with the user. The program should ask the user…
A: sample output
Q: 5-WRITE A PROGRAM THAT CALCULATES A STUDENT'S AVERAGE IF IT IS LESS THAN 50, SPECIFYING THE…
A: As per company guidelines we are suppose to answer only 1 question. Kindly re-post other…
Q: Python Assignment: In India McDonald's has the n number of customers and they are famous for their…
A: Coded in Python 3.
Q: Programming challenge description: When John was a little kid he didn't have much to do. There was…
A: Actually, java is a object oriented programming language. It is a platform independent.
Q: C++ code Assignment: While still in school, Sam had the ability to solve problems. Now one of his…
A: As per the given problem we are required to develop a C++ to solve the given number problem. For…
Q: V7 This pseudocode is intended to display // employee net pay values. All employees have a standard…
A: Program plan: Declare the variable name Define the variable EOFNAME as "ZZZZ" Define DEDUCTION as…
Q: Day of the Week Calculator For this assignment you will write a program that will allow you to enter…
A: Code: import java.util.Scanner; public class test { static String days[]=…
Q: Day of the Week Calculator For this assignment you will write a program that will allow you to enter…
A: To find the day of a given number in Java, the date is given as input, we will use Calendar class,…
Q: Credit Card Number Check. The last digit of a credit card number is the check digit, which protects…
A: Program approach: import the necessary packages required for scanning the input from user create a…
Q: Combine the first name, middle name, and last name and assign it as the 'fullname' of the hero. If…
A: Implementing given program in C++.
Q: Trivia Game In this programming exercise, you will create a simple trivia game for two players. The…
A: Question.py • Define the class named “Question”. ○ Define “__init__()” method for “Question”…
Q: Credit Card Number Check. The last digit of a credit card number is the check digit, which protects…
A: Actually, the code has given below:
Q: (Geometry: area of a triangle) Write a program that prompts the user to enter three points (x1, yl),…
A: Given:
I need help writing program 13 in python.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images
- 9. Trivia Game In this programming exercise, you will create a simple trivia game for two players. The program will work like this: Starting with player 1, each player gets a turn at answering 5 trivia questions. (There should be a total of 10 questions.) When a question is displayed, 4 possible answers are also displayed. Only one of the answers is correct, and if the player selects the correct answer, he or she earns a point. After answers have been selected for all the questions, the program displays the number of points earned by each player and declares the player with the highest number of points the winner. To create this program, write a Question class to hold the data for a trivia question. The Question class should have attributes for the following data: A trivia question Possible answer 1 Possible answer 2 Possible answer 3 Possible answer 4 The number of the correct answer (1, 2, 3, or 4) The Question class also should have an appropriate _…Craps is a single player dice game, that proceeds as follows:1. the player rolls 2 six-sided dice once if the total is 7 or 11, the player wins if the total is 2, 3 or 12, the player loses otherwise, the game continues, ... see 2 ... 2. the player the continues to roll the dice repeatedly, until ... the total is the same as the original total (from 1), in which case the player wins the total is 7, in which case the player loses Write a function craps using Python that simulates a single game of craps (may be many rolls) and returns 1 if the player wins and 0 otherwise. Sample results examples: >> import random>>> random.seed(0)>>> craps()0 >>> random.seed(1)>>> craps()1 >>> random.seed(2)>>> craps()0 >>> [ (i,random.seed(i),craps()) for i in range(20)][(0, None, 0), (1, None, 1), (2, None, 0), (3, None, 1), (4, None, 0), (5, None,1), (6, None, 0), (7, None, 1), (8, None, 0), (9, None, 0), (10,…Bulgarian solitaire def bulgarian_solitaire(piles, k): You are given a row of piles of pebbles, all identical, and a positive integer k so that the total number of pebbles in these piles equals k*(k+1)//2, the arithmetic sum formula that equals the sum of positive integers from 1 to k. Almost as if intended as a metaphor for the bleak daily life behind the Iron Curtain, all pebbles are identical and you don't have any choice in your moves. Each move picks up one pebble from each pile (even if doing so makes that pile vanish), and creates a new pile from the resulting handful. For example, starting with[7, 4, 2, 1, 1], the first move turns this into [6, 3, 1, 5]. The next move turns that into [5, 2, 4, 4], which then turns into the five-pile configuration [4, 1, 3, 3, 4], and so on. This function should count how many moves are needed to convert the given initial piles into the goal state where each number from 1 to k appears as the size of exactly one pile, and return that count. These…
- Java Questions - (Has 2 Parts). Based on each code, which answer out of the choices "A,B,C,D,E" is correct. Each question has one correct answer. Thank you. Part 1 - 9. Given the following code, the output is the date and time of __.Calendar cal = Calendar.getInstance(); TimeZone tz = TimeZone.getTimeZone("Europe/Rome");TimeZone tz = TimeZone.getTimeZone("America/Los_Angeles");TimeZone tz = TimeZone.getTimeZone("Asia/Istanbul");System.out.println(cal.getTime()); A. the "Europe/Rome" time zone.B. the time zone is computer is currently set to use.C. the "America/Los_Angeles" time zone.D. the "Asia/Istanbul" time zone.E. All of the three listed time zones. Part 2 - 10. Given the following code, the output is the date and time of __. Calendar cal = Calendar.getInstance();TimeZone tz = TimeZone.getTimeZone("Europe/Rome");cal.setTimeZone(TimeZone.getTimeZone("America/Los_Angeles"));TimeZone tz = TimeZone.getTimeZone("Asia/Istanbul");System.out.println(cal.getTime()); A. the "Europe/Rome"…7) The ideal gas law allows the calculation of volume of a gas given the pressure(P), amount ofthe gas (n), and the temperature (T). The equation is:V = nRT / PSince we only have used integer arithmetic, all numbers will be integer values with nodecimal points. The constant R is 8.314 and will be specified as (8314/1000). This givesthe same result. Implement the idea gas law program where the user is prompted for andenters values for n, T, and P, and V is calculated and printed out. Be careful toimplement an accurate version of this program. Your program should include a properand useful prompt for input, and print the results in a meaningful mannerTo make telephine numbers easier to remember, some companies use letters to show their telephone number. For example, the telephine number 438-5626 can be shown as GET-LOAN. In some cases, to make a telephone number meaningful, compaines might use more than seven letters. For example, 225-5466, can be displayed as CALL-HOME, whic uses eight letters. Write a program that prompts the user to enter a telephone number expressesd in letters and outputs the corresponding telephone number in digits. If the user enters more than seven letter, then process only the first seven letters. Also, output the -(hyphen) after the third digit. Allow the user to use uppercase and lowercase letters, as well as spaces between words. Moreover, your program should proces as many telephone as the user wants. (Hint: You can read the entered telephine number as a string and then use the charAt() to extract each character.)
- Chapter 5. PC #17. Rock, Paper, Scissors Game (page 317) Write a program that lets the user play the game of Rock, Paper, Scissors against the computer. The program should work as follows. 2. When the program begins, a random number in the range of 0 through 2 is generated. If the number is 0, then the computer has chosen rock. If the number is 1, then the computer has chosen paper. If the number is 2, then the computer has chosen scissors. (Do not display the computer choice yet.) 3. The user enters his or her choice of "rock", "paper", or "scissors" at the keyboard. You should use 1 for rock, 2 for paper, and 3 for scissors. Internally, you can store 0, 1, and 2 as the user choice, to match with the above schema. 4. Both user and computer choices are displayed. 5. A winner is selected according to the following rules: If one player chooses rock and the other player chooses scissors, then rock wins. (The rock smashes the scissors.) If one player chooses scissors and…Rock, Paper, Scissors Game Create a application using (C#) in Microsoft Visual Studio that lets the user play the game of Rock, Paper, Scissors against the computer. The program should work as follows.1. When the program begins, a random number in the range of 1 through 3 is generated. If the number is 1, then the computer has chosen rock. If the number is 2, then the computer has chosen paper. If the number is 3, then the computer has chosen scissors. (Do not display the computer’s choice yet.)2. The user selects his or her choice of rock, paper, or scissors. To get this input you use clickable PictureBox controls displaying some of the artwork that you will find in the student sample files.3. The computer’s choice is displayed.4. A winner is selected according to the following rules: •If one player chooses rock and the other player chooses scissors, then rock wins. (Rock smashes scissors.)•If one player chooses scissors and the other player chooses paper, then scissors wins.…Question # 4: Write a program that calculates the electricity bill. The rates of electricity per unit are as follows: If the units consumed are 300 and 8 2000 2750 Question # 6: Write a program that converts the angle from degree to radian and displays each value.
- Assignment Write a program that moves a forester unit and a desert corps unit to a given target location and prints the number of hours it took for each unit to reach the target. First, the user will give the starting X and Y positions of the forester unit as well as its base speed (all ints). Then, the starting X and Y positions of the desert corps unit as well as its base speed (all ints). Finally, the target X and Y positions (both ints) and the terrain type (std::string). Speeds are given as distance traveled in one full day (i.e., 24 hours) and is affected by the terrain type using a multiplier over the base speed. Also, after 1 full day, each unit rests for a certain number of hours. Speed multiplier and rest amount of each type of unit depending on the terrain type are as below. Speed Multiplier Rest Duration After 1 day Terrain type Forester Desert Corps Forester Desert Corps Forest 1.3 0.6 4 12 Desert 0.4 1.2 15 6 Hills 0.7 0.8 6 8 Others 1.0 0.8 8 6 After getting all this…Input a number value for LEFT, RIGHT and X. If LEFT is greater than RIGHT, display the first ten numbers in descending order starting from X. If RIGHT is greater than LEFT display the first ten numbers in ascending order starting from X. If RIGHT and LEFT are equal, display “Equal Value” Use the UML diagram below as a guide. The following methods are as follows. setValues(int,int,int) – accepts the value for X, LEFT and RIGHT as parameters and returns the following: 0 if LEFT and RIGHT are equal 1 if LEFT is greater than RIGHT 2 if RIGHT is greater than LEFT. displayCount(int) – accepts the integer that represents the status of RIGHT and LEFT, and then display the expected result.Java question Write a program that plays the Rock-Paper-Scissors game againstthe computer. When played between two people, each personpicks one of three options (usually shown by a hand gesture) atthe same time, and a winner is determined. In the game, Rockbeats Scissors, Scissors beats Paper, and Paper beats Rock. The program should randomly choose one of the three options (with-out revealing it), then prompt for the user's selection. At that point, the program reveals both choices and prints a statementindicating if the user won, the computer won, or if it was a tie.Continue playing until the user chooses to stop, then print thenumber of user wins, losses, and ties.