please write a code for that
Q: Run the code below:
A: Task :- Run the given python program with sample input. Python program :- #Get the user's…
Q: Evaluate the following postfix expression: 10 5 + 2 * 3 3 / %
A: 10 5 + 2 * 3 3 / % FINAL ANSWER IS 0 . Step 1 - Firstly Push the 10 and 5 into the stack . Step 2 -…
Q: this is valid c++ code inside the main(): int a = 10; int b = 20; %3D
A: In the provided code ,it is
Q: Nhat are the values of mynum[0], mynum [1], and mynum[2] after the following code executes? double[]…
A: this is a simple output based question
Q: Which is correct with respect to the size of the data types? ans. double > char >int char>int> float…
A: Option C Char<int<double
Q: how to fix this error code
A: Required:
Q: In the code below for ***: for ***: print('@') print() replace the *** so that when you…
A: Description:A for loop is a loop used in the programming language to control the flow of a…
Q: What will be the output of the following C code? #include struct student char *c; struct student…
A: I have given an answer in step 2.
Q: ) Declare the integer variable z with value 10 without using assignment('=) operator.
A: = is called as assignment operator as it assigns value present at right side to variable at left…
Q: Test whether variable count is greater than 20. If it is, display “Count is greater than 20”.
A: Given: Test whether variable count is greater than 20. If it is, display “Count is greater than…
Q: Please explain why this code has program output: **********
A: The solution to the given problem is below.
Q: in this code, what does 2 mean and what does it do?
A: Answer: This Matlab program finds the accel values. First we want to declare 2d array for y. e.g. y…
Q: Form1 enter the value of x
A: VB.Net program to create the simple calculator :Module Module1 Sub Main() Dim choice As…
Q: Q2: complete the function that returns the area of a circle with radius r, note, use math.pi for pi.…
A: Given: To complete the python code.
Q: O YOUR OWN CODE.
A: I have written the code below:
Q: Write code that outputs variable numObjects. End with a newline.
A: Note: Since the programming language is not defined, So the programming language used here is JAVA.…
Q: Show the value that gets stored in the indicat int ans - 20, x - 50, y - 75; if (x >= y) ans + x +…
A: Solution: Value stored in ans = 20 , x = 50, y= 75 if( x >= y) ans += x+ y else ans +=…
Q: What does this code print? Print (2**2**3*2)
A: ** represents exponent and has higher precedence than any other operator These exponents are nested…
Q: Write a code that will accept input of firstname from the user for exactly five(5) times. Then…
A: The question is to write python code for the given problem.
Q: Code: % DO NOT MODIFY THIS % Input: questionNum -> between 0 and 6 that de
A: Answer:- The rate of diffusion
Q: int z=3, s um =0; while (z<7) { Z+=2; Sum-Cumt7 .
A: The answer is as follows:-
Q: Please fix this code:
A: where is your code please uploade the question in a write way you have not shareed the code
Q: The following function has errors. Locate as many errors as you can. void area(int length = 30, int…
A: Correction Explanation: The argument length should be declared inside the function body or at the…
Q: d * downvote for incorrect as well because co
A: I have designed using HTML. I have used the under tag to make this flag and i have styled the flag…
Q: They should type them in a line with spaces or commas between (specify which). Drop the lowest two…
A: Python used to answer this question
Q: Write a code to check if it is a strong number or not
A: As the coding language is not given so i am doing this code in C language: #include…
Q: void (double a) cout<<"" a = "; cout<<a<<endl; ... %3D
A: Given:
Q: In C++ Please if you could show your work.
A: The answer is given below.
Q: Fill-in-the-Blank __________ variables are designed to hold addresses.
A: The Pointer in C, is a variable that stores address of another variable. ... A pointer can be…
Q: Write a code snippet that can arrange the alphabets of a name entered by user in alternate cases.…
A: #include<iostream>using namespace std;int main(){ string str; cout << "Input : ";…
Q: What is the output of this code? char ch = 'M' + 3; cout << ch;
A: when we compile above program it prints 'P' the output of the code is 'P'(M+3=P)
Q: Please show the output of the code!
A: Given, We have to provide the output of the given code, Code: #include <stdio.h> union…
Q: After this code is executed the value of str is:
A: After executing above two statement value of str is xyYw (second option)
Q: Comment next to each line of code and write what each line does
A: Step 1) Comment lines are used for the explanation of steps so that the code can easily be…
Q: What is the output of this code
A: In this question, a code segment is given and we are asked to give the correct output Given Code:
Q: What will be the output of code given below.
A: In the given code we are given : Integer variable n = 10. Pointer to integer variable m, which…
Q: void kar2(char "b, char "a, char "c) "a = 'b'; "b='c'; *c ='a';
A: Output:
Q: def func(a, b, c): q = b* b - 4 * a *c if q >= 0: return q ** 0.5 else: return -1 r = func (1, 6, 5)…
A: Programming is language is python as per understanding
Q: write the code that rounds the variable b to the nearest smallest value
A: Program: import java.io.*; class ABC{ // Program to round the number to the // nearest number…
Q: What is this code's purpose? $Error=[] ;
A: The Answer is in step2
Q: output is produced when previous1 = 1,
A: Given :- In the above question, the algorithm is mention in the above given question Need to write…
Q: Help in Java please - I am receiving invalid statement codes for this application Write an…
A: public class TriangleYN{public static void checkTriangle(double a,double b,double c)//our static…
Q: Write a function that parses a binary number into a hex number.The function header is:def…
A: Function that parses a binary number into a hex number. The function header is: def…
Q: Nhat is the output from the following code segment? int point = 1; while ( point ! = 13) { cout <<…
A: Answer to the above question is in step2.
Q: int this as soon as Code design.
A: I have written HTML Code below:
Q: what is the worst case of the code below
A: Task :- find out the worst case runtime of the given code.
Q: The following function has errors. Locate as many errors as you can. void total(int value1, value2,…
A: GIVEN: The following function has errors. Locate as many errors as you can. void total(int value1,…
Step by step
Solved in 4 steps with 1 images
- Using C# in Microsoft Visual Studio create an application 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 is2, 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 can use Button controls, or 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. (Scissors…Theater Ticket System: A small ten-seat theater has contracted you to build software which will reserve tickets. The theater has two rows of five seats each. Each row is referred to by number (1 or 2) and each seat in the row is referred to by letter (A, B, C, D, and E). When started, the program should ask the user for the row they prefer (row selection). If that row has no empty seats then the program should ask the user if they prefer the other row, if no then display a message stating the next show is tomorrow. Upon selecting a row, the program should present the user with a choice of available seats in the row. The user can then either choose a seat and print the ticket (in this case a simple message will suffice) or return to row selection. If a ticket is printed the program should return to row selection. The program terminates when all seats are reserved. Please enter a row: 1 Available seats: A B C D E Which seat, enter Q for none?: B You have booked seat: 1B…Theater Ticket System: A small ten-seat theater has contracted you to build software which will reserve tickets. The theater has two rows of five seats each. Each row is referred to by number (1 or 2) and each seat in the row is referred to by letter (A, B, C, D, and E). When started, the program should ask the user for the row they prefer (row selection). If that row has no empty seats then the program should ask the user if they prefer the other row, if no then display a message stating the next show is tomorrow. Upon selecting a row, the program should present the user with a choice of available seats in the row. The user can then either choose a seat and print the ticket (in this case a simple message will suffice) or return to row selection. If a ticket is printed the program should return to row selection. The program terminates when all seats are reserved.
- Slot Machine SimulationA slot machine is a gambling device that the user inserts money into and then pulls a lever (or presses a button). The slot machine then displays a set of random images. If two or more of the images match, the user wins an amount of money that the slot machine dispenses back to the user. Create a program that simulates a slot machine. When the program runs, it should do the following: Asks the user to enter the amount of money he or she wants to enter into the slot machine. Instead of displaying images, the program will randomly select a word from the following list: Cherries, Oranges, Plums, Bells, Melons, Bars To select a word, the program can generate a random number in the range of 0 through 5. If the number is 0, the selected word is Cherries; if the number is 1, the selected word is Oranges; and so forth. The program should randomly select a word from this list three times and display all three of the words. If none of the randomly selected words match, the…20. Random Number Guessing GameWrite a program that generates a random number in the range of 1 through 100, and asks the user to guess what the number is. If the user’s guess is higher than the random number, the program should display “Too high, try again.” If the user’s guess is lower than the random number, the program should display “Too low, try again.” If the user guesses the number, the application should congratulate the user and generate a new random number so the game can start over.Optional Enhancement: Enhance the game so it keeps count of the number of guesses that the user makes. When the user correctly guesses the random number, the program should display the number of guesses. USE RAPTOR PROGRAMRandom Number Guessing Game Create an application that generates a random number in the range of 1 through 100 and asks the user to guess what the number is. If the user’s guess is higher than the random number, the program should display “Too high, try again.” If the user’s guess is lower than the random number, the program should display “Too low, try again.” If the user guesses the number, the application should congratulate the user and then generate a new random number so the game can start over. Optional Enhancement: Enhance the game so it keeps count of the number of guesses that the user makes. When the user correctly guesses the random number, the program should display the number of guesses.
- 99 question 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 tells the 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. If the ticket number is valid, save the number to a .txt file called “tickets.txt” and.Dice game Rules of the game: The players roll three dice, and the program adds the sides that turn up. After the first roll of the three dice, a player may choose to roll the dice as many times as they wish until the player gets at least one side 2 from a dice. When a player gets at least one side 2 from the dice, that player's score drops to zero, and the turn switches to the other player. Both players play the game for an equal number of turns, and the player who gets a score higher than 18 wins. If both players get a score higher than 18 within an equal number of turns, the player with the higher score wins. If both of the players got the same scores, print the scores of the players. These are the minimum required functions for this program. Design and implement these functions. You can create more functions if you choose to. Here is the provided starter code: # A program to play a Dice game. import random def roll_die(): ''' Simulate a die roll ''' def…(Simulation) Write a program to simulate the roll of two dice. If the total of the two dice is 7 or 11, you win; otherwise, you lose. Embellish this program as much as you like, with betting, different odds, different combinations for win or lose, stopping play when you have no money left or reach the house limit, displaying the dice, and so forth. (Hint: Calculate the dots showing on each die with the expression dots=(int)(6.0randomnumber+1), where the random number is between 0 and 1.)
- For each of the following exercises, you may choose to write a console-based or GUI application, or both. Write a program for The Carefree Resort named ResortPrices that prompts the user to enter the number of days for a resort stay. Then display the price per night and the total price. Nightly rates are $200 for one or two nights; $180 for three or four nights; $160 for five, six, or seven nights; and $145 for eight nights or more.Number Guessing Game. The program will generate a random number from 1 to 1000. The player will be given several chances to guess the number. The program gives a hint that the given number is lower or higher. If the player's guess is correct, give the player a single point. Tally the number of correct and wrong guesses that the player has made. After every round, display the tally (correct, wrong, and score) After a cycle the program will ask the user if he wants to continue playing. This is a console project. Below source code is my answer with the Question. Kindly check it sir/maam if i have the problem with the code. Thank you using System;using System.Collections.Generic;using System.Text;class Program{static void Main(string[] args){while (true){int randno = Newnum(1, 1001);int count = 1;while (true){Console.Write("Enter a number between 1 and 1000(0 to quit):");int input = Convert.ToInt32(Console.ReadLine());if (input == 0)return;else if (input <…An online book club awards points to its customers based on the number of bookspurchased each month . Points are awarded as follows:Books Purchased01234 or morePoints Earned051530soWrite a program that asks the user to enter the number of books purchased this monthand then displays the number of points awarded .