Write (1) the pseudo code, (2) the code, of the following problems: A video club wants to reward its best members with a discount based on the member’s number of movie rentals and the number of new members referred by the member. The discount is in percent and it is equal to the sum of the rentals and the referrals, but it cannot exceed 75 percent. Write a program to calculate the value of the discount.
Q: i want code in python PrepBuddy And You You and PrepBuddy are standing at the two opposite ends…
A: Coded in Python 3.
Q: Write the Python 3.3 program for the following problem. A monkey is being fed some food. Read in the…
A: Python used to answer this question
Q: From time to time Yetis who live high up in the Himalayan mountain ranges come down from the…
A: Step 1 : Start Step 2 : Define a function isValidYeti() which takes the code as argument and return…
Q: A tic-tac-toe grid of size n is a grid composed of empty tiles bounded by solid lines. The grid is…
A: The following is the code with comments I tried to my best to comment as clear as possible.
Q: With the help of a Python program, help a contractor such that he can enter the length(in feet),…
A: Start input l,b, h and cost calculate area = 2(l+b)h+lb print area calculate cost = cost *area print…
Q: Solve in python: When analyzing data sets, such as data for human heights or for human weights, a…
A: First input number of elements. Then input each element. Pass both the values to function…
Q: Python to calculate the sum of the numbers from 1 to 1000, inclusive, except omitting from the…
A: Please find the answer below :
Q: Suppose you are a farmer at a big area of land and you have been growing Bamboo trees. You bought…
A: As per the given problem statement we are given a task to develop a python code to find minimum…
Q: his is python programming Create a function based on the following information: Your mission is…
A: Caesar cipher is a type of substitution cipher which follows a simple encryption method. In this…
Q: The State Department of Motor Vehicles (DMV) has asked you to write a program that grades the…
A: Program Plan:- Initialize all the header files. Ask the user to enter the values of n candidates…
Q: tic-tac-toe grid of size n is a grid composed of empty tiles bounded by solid lines. The grid is…
A: In the following block I have pasted the code with comments. I request you to go through and run in…
Q: Ask the user to type a character Ask the user to type a number for the width Print a rectangle…
A: Use a loop to print in each line and in case of first and last row, same character will be displayed…
Q: Every cell (x,y) contains an integer ax,y signifying the course of how the ball will move. ax,y=1 —…
A: Here have to determine about Jeopardy of Dropped Balls code for given problem.
Q: Instructions: Print out the cube values of the numbers ranging from 1 to 1000 (inclusive). However,…
A: """Write a program that prints cube of numbers from 1 to 10 whichare not divisible by 3 or 5""" #Run…
Q: In 1937, a German mathematician named Lothar Collatz formulated an intriguing hypothesis (it still…
A: Python program is given below :
Q: Write a pseudo-code or an algorithm for the problem below. Add comments and clearly explain what you…
A: Problem Explanation: In this problem you are to write a program to explore the above array for a…
Q: In Python, using import sys Create a program, quadratic.py, that takes in three arguments that…
A: Hey there, I am writing the required solution based on the above given question. Please do find the…
Q: Create a python code to solve this exercise: The Koch snowflake is a fractal shape. At level 0, the…
A: import turtle #recursive method to draw a fractal line with given distance, angle and levelsdef…
Q: 23. The following python program can work with parameters. def f(x): def f1(*args, **kwargs):…
A: The above python program can work with combining keyword and non keyword variable length parameters.…
Q: Write down a complete PYTHON program to do the followings; enter the information of a set of…
A: print("Enter the number of workers: ")numOfWorkers = int(input())#Then we take the hour…
Q: Write a funtion transform (word, num_day) that takes as an argument a word and the number of the day…
A: In this question, we are asked to write function in python which return the transformed word as per…
Q: You must use Python to solve the following problem. You will need to run the codes and print both…
A: This problem is a case of a Quadratic equation having two roots. This can be solved using the…
Q: this is python Output range with increment of 10 Write a program whose input is two integers.…
A: PROGRAM: #Getting the input num1=int(input("Enter the first number:")) num2=int(input("Enter…
Q: Python. Please, help me to write a program that takes three straight lines of type ax + by + c = 0…
A: Python program to check if the given three straight lines is in general position or not. straight…
Q: Implement a fahrenheit function that returns theFahrenheit equivalent of a Celsius temperature. Use…
A: def celciusToFahrenheit(cel): #function that takes in one numeric argument representing a…
Q: If the following Python code is executed, what will be the type and value of the last expression…
A: Hi. Let's move on the answer in the next step. I have included explanation in comments in the code…
Q: Using Python, use import sys to create a program Create a program change.py, that has a function…
A: def value_of_change(l): quarters = .25 dimes = .10 nickels = .05 pennies = .01 total…
Q: 8. What will be the output of the following Python code? x = "abcdef" i = "a" while i in x:…
A:
Q: Add a main function to the following python code and organize the program using mainline logic.…
A: - Adding main in code.
Q: Suppose that the city of Sochi can be described as a 2D matrix. Each cell may or may not contain a…
A: Given we have to develop a python code to print the minimum number of baskets that will be required…
Q: . Write a Python program that will compute the final grade of a student. Final Grade is 30% average…
A: PROGRAM EXPLANATION: Define a function final grade() to calculate the final grade of the student.…
Q: Write a program that displays a salary schedule, in tabular format, for teachers in a school…
A: This was very similar like Compound Interest The Salary is calculated for an year using the formula…
Q: 56. What will be the output of the following Python code snippet? x=3.3456789 '%f | %e | %g'…
A: Question 56. What will be the output of the following Python code snippet? x=3.3456789 '%f |…
Q: write a program that simulates the “Rock-paper-Scissors” game. In this game the user and the…
A: Python 3 code is as follows:-
Q: Python code fragment below, fix any error and give the output. Basic question, kindly help! toys =…
A: #first lets analyse the code for errors: toys = ['ball', 'car', 'soldier']#declaring list of…
Q: 2. Fibonacci sequence is series of numerical terms where each term depends on two previous terms…
A: Solution: Given,
Q: or the three poiats 4 (Xa, Ya), B (Xb, ¥5) and C (Xe, ¥e) the cquation of the line L parallel to the…
A: Java Code :- public class MyClass { public static void main(String args[]) { double…
Q: Write the program code for stochastic hill climbing and gradient descent in python (I need the code…
A: SUMMARY: - Hence, we discussed all the points.
Q: Mr Jone has two walls of different dimensions such that their dimensions are to be given input in…
A: feet1, inch1 = input("Enter the height of wall 1 : ").split()feet2, inch2 = input("Enter the width…
Q: Python code fragment below, fix any error and give the output. Basic question, kindly help! toys =…
A: Below I have provided Python Programming. Also, I have attached the screenshot of the code and…
Q: 21.4 LAB: Parsing dates Write a program to read dates from input, one date per line. Each date's…
A: Python program to solve the given problem is below.
Q: Five hospitals in Oman keep a record of the Covid infections since 01/04/2020. Each day they enter…
A: Please find the answer below
Q: Q} Solve the below programming problem using Python Charle, the Ben Prankster is back in action now…
A: The Journey ben and his friends can be described as follows. There is a total of B dishes on the…
Q: Q} Solve the below programming problem using Python Charle, the Ben Prankster is back in action now…
A: Here is the detailed and simplified python code for the given question:
Q: 1. Type the expressions below in python interactively, and try to explain what's happening in each…
A: Note :- As per bartleby guideline we are allowed to solve only first question. So i am unable to…
Q: I NEED HELP TO MAKE THIS CODE RUN AND GIVE ME A PI VALUE, WITHOUT CREATING A DIFFERENT CODE. COULD I…
A: Check further steeps for the answer :
Q: PYTHON In the following cell, complete the code so that N is returned when the difference between…
A: def good_enough(C,r): """Return the smallest value of N that satisfies true_value -…
Q: Write python programs to solve below problems in Jupyter note book, Then downle the programs as…
A:
Q: Limurians live on the planet Lemuria where the passage of time is measured in lims (days), limhas…
A: Algorithm of limurian_age.py file : Declare variables according to the number of days lived by…
Python Help
Write (1) the pseudo code, (2) the code, of the following problems:
A video club wants to reward its best members with a discount based on the member’s number of movie rentals and the number of new members referred by the member. The discount is in percent and it is equal to the sum of the rentals and the referrals, but it cannot exceed 75 percent. Write a program to calculate the value of the discount.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images
- Please code in python Being tired of the challenging assignments given by the MCS Professors, students have collectively decided to have a roasting contest with the professors. We divide participants into two teams: students and professors. Each participant gets 500 points for their team when they roast a participant from the opposing team. Moreover, if the same participant roasts someone from the opposing team again within 10 minutes, their team gets an additional 500 points. For example, if a participant roasts twice within 10 minutes, their team gets 500+500 = 1000 points. As another example, if a participant roasts for the first time, roasts for the second time within io minutes, and then roasts within 10 minutes of their second roast, their team gets 500 + (500 + 500) + (500 + 500) = 2500 points. Input The first line contains the integer n (1 <= n <= 200), the number of times participants roasted each other in the contest The second line contains the integer ml denoting the…i want code in python PrepBuddy And You You and PrepBuddy are standing at the two opposite ends of the line and playing a game. There are NN candies placed in a line. PrepBuddy starts eating candies from left to right and you start from right to left. For each candy, the time needed to finish the candy is given. When the player (PrepBuddy or you) finishes the candy he immediately starts with another. It is not allowed to eat two candies at the same time, to leave the candy unfinished, and to make pauses. If both players start to eat the same bar simultaneously, You leave it to PrepBuddy as a true gentleman. How many candies each of the players will consume. Input format The first line contains a single integer TT - the number of test cases. The first line of each test case contains a single integer NN - the number of cadies. The second line of each test case contains NN - space separated integer T1,T2......TNT1,T2......TN- the time to finish ithith candy. Output format For each test…Please answer it in Python Suppose we play a game where each round takes place in the following way: first, we roll a dice, and its result gives the number of points at stake. Then, the player can, if he wishes, trigger his bonus "double account" or his bonus "triple account". Then, the player answers a number of questions, and calculates his percentage of correct answers. The points awarded to the player for that round are then calculated based on the percentage of correct answers and the number of points in play rounded to the nearest integer (for example, with 50% correct answers and 6 points in play, the player gets 3 points; with 45% correct answers and 8 points in play, the player gets 4 points). Finally, this number of points is possibly multiplied by two or three if the corresponding bonus has been used. Write a function points_match that takes as an argument the percentage, the number of points at stake, and as an optional argument the multiplier (which is worth 2 in a double…
- language: Python Problem: Write a function log2(x), which gives an integer approximation of the log base 2 of a positive number x, but it does so using recursion. Use a base case where you return 0 if x is 1 or less. In the general case, add 1 to the answer and divide x by 2. On top of writing the function, also write a test case for the function to prove the program works.(IN PYTHON) Problem 2 Write a function count_8s(string) that performs the following actions: Receives a single parameter called string that we expect to be a string. If we receive something that is NOT a string, raise a TypeError with the message “Non-string input received.” Uses recursion to count the number of eights in the string. Use a string of length 0 as your base case. Otherwise, determine if the first character in string is “8” or not, and call count_8s() again with the rest of the string as an argument. Returns the number of eights found in the string. NOTE: You are not to use a while or for loop in your code.PYTHON A perpetuity pays a coupon value of C each and every period forever. Given a discount rate of r, the value of a perpetuity is given by V=∑t=1∞C(1+r)t Thus, the value of a perpetuity is described by an infinite series. Mathematically, this summand can be reduced to V=C/r We'll refer to the first equation above as the "summation formula" and the second equation as the "shortcut formula". That is, the summation formula uses an infinite series, whereas the shortcut formula expresses the value of a perpetuity as simply the ratio of the coupon value to the discount rate. Create a function that returns the value of a perpetuity using the shortcut formula. def shortcut_formula(C, r):
- Write code in python - Problem 3 A bag contains 45 apples, 65 oranges and 30 bananas. Find the percentage of each type of food items in the bag. [ ] \# Calculate the percentage of apples and print the variable [ ] \# Calculate the percentage of oranges and print the variable [ ] \# Calculate the percentage of bananas and print the variablePython. Please, help me to write a program that takes three straight lines of type ax + by + c = 0 and checks if the given straight lines are in general position.THE FOLLOWING PROGRAM MUST BE DONE IN PYTHON. From time to time Yetis who live high up in the Himalayan mountain ranges come down from the mountains to deliver a profound message, in their own language, to the folks in the plains. The folks in the plains look forward to listening to these profound messages. The Yetis' language is called Yetian where the characters, as we know, are represented by 3 digits which cannot be understood by the folks in the plains. Hence, Yetis' come with a translator so that everyone listening to the message can understand it. This time around, Yowie the Yeti came down to deliver the message, but forgot to bring the translator. Mr. Coder in the plains has asked you to help code a translator based on the following rules that he gathered from his previous experiences with the Yetis. Yeti messages always contain three digits for each character, unless a mistake has been made. Hence, the length of a valid Yeti message is always a multiple of three. Each…
- Please do this in Python Programming and provide Screenshots The output should be exact same like in the examples. If the output in the example is in 2 decimals, then it should be like that. 1c - Othello 1 Othello, is a 2-player deterministic (no use of dice), perfect information (no information only known to one of the players) board game, similar to chess or go. The goal of this assignment is to give some information about the outcome once an Othello game has finished. This information is obtained by two measurements: The percentage of black pieces of all the pieces on the board. The percentage of the board that is covered in black pieces. The Othello board measures eight squares by eight squares, making the total number of squares sixty-four. Write a program that takes the number of white pieces followed by the number of black pieces as input. Print the two percentages as output. Enter the number of white pieces on the board: 34Enter the number of black pieces on the board:…ALL DONE IN PYTHON PLEASE!!!! In many businesses across the country, people are buying food and goods using cash. Whenever a purchase is made with cash, it is usual that change must be back to the customer. Business point of sales software help to ensure that the correct change is return to a customer by providing detailed information of the change that should be returned to the customer. using the fewest number of bills and coins. In this assignment, you are asked to use what we have covered in Modules 1-3 to design and implement a program that writes out what bills (ones, fives, tens, twenties) and coins (pennies, nickels, dimes, and quarters) that should be returned to the customer given two inputs from the user: A total cost of a sale. The amount that was paid by the customer. Ensure that your output is grammatically correct. If the customer does not provide adequate payment, you should print the following statement, the program should end. Did not receive enough cash from the…WRITE CODE IN C LANGUANGE On their way down the river, Jojo and Lili saw two frogs each in position X1 and X2. The two frogs are seen jumping happily towards the same direction that is come to Jojo. After watching the two frogs, Joio and Lili saw that the speed the two frogs are different. The first frog to start jumping from position X1 has a speed of v1, while the second frog that starts to jump from position X2 has a speed of V2. Joig guess that "YES" both frogs will be in the same position in a certain time T, while Bibi guessing "NO" the two frogs will never be in the same position in time. Help Joio and Lili calculate the frog's movements to determine whether the guess they are right