Run the following Program 12.5 and answer the following questions. [Laksanakan Program 12.5 berikut dan jawab soalan-soalan berikut.] //Program 12 5
Q: Python: On-line Grocery Shopping Use grocery py in Canvas to start your program. It contains two…
A: Answer: Code: food = ["tomato_soup", "cheese", "sauce", "chicken"] stock = {"tomato_soup": 20,…
Q: Create two functions using Fortran : Factorial and Area. The factorial function is a recursive…
A: Hey there, I am writing the required solution of the above stated question.Please do find the…
Q: Python code Write a function that, given two integers, return the product of every integer between…
A: As per our guidelines we are suppose to answer only first question. Kindly repost other question…
Q: Write a function for solving a quadratic equation using the following header:def solveQuadratic(eqn,…
A: def solveQuadratic(eqn, roots): a = float(eqn[0]) b = float(eqn[1]) c = float(eqn[2])…
Q: Python Programming- Computer-Assisted Instruction Part 1: Computer-Assisted Instruction (CAI)…
A: Hey, since there are multiple part questions posted, we will answer the first part question. If you…
Q: The following program calculates yearly and monthly salary given an hourly wage. The program assumes…
A: Annual salary is the total salary of an year calculated based on number of work hours. It's equally…
Q: A recursive function resulted in an infinite process. The problem is most likely the result of…
A: 1) A recursive function is a function that calls itself within its own definition. Each time the…
Q: CodeWorkout Gym Course Search exercises... Q Search kol X459: Review Fibonacci In mathematics, the…
A: Given: To write a recursive function that returns nth fibonacci number:
Q: 344614.2214230.qx3zqy7 2 def double_pennies (num_pennies, num_days): total_pennies - e 4 5 * Your…
A: def double_pennies(num_pennies, num_days): total_pennies = 0 total_pennies = num_pennies if…
Q: The code box below defines a variable route as a list of directions to navigate a maze. Each…
A: In this question we have to create a function that navigates a two-dimensional space using a list of…
Q: Using the following header, create a recursive function that shows an integer value backwards on the…
A: Recursion is a process by which a function calls itself repeatedly till it falls under the base…
Q: /** • PROBLEM 3: The following function draws miskey mouse, if you call it like * this from main: *…
A: the answer is given below:-
Q: Clarification: Q.2 You are counting points for a basketball game, given the amount of 3-pointers…
A: In this question we have to understand the code for python program of counting points for a…
Q: a program that reads a input question (full question) from the user and then matches it with already…
A: It is defined as The best way to learn Python is by practicing examples. The page contains examples…
Q: CodeWorkout X265: Recursion PIogramming Exercise:
A: Lets see the solution.
Q: tasks: 1. Create a function called "Load_Dataset". The function should read the attached dataset…
A: task 1: Create a function called "Load_Dataset". The function should read the attached dataset…
Q: 09. Python Write the in_order() function, which has a list of integers as a parameter, and returns…
A: Solution Python program: def in_order(nums) : #Here for loop starts from 0 to nums-1…
Q: Common Time Zones Function Name: commonTimeZones() Parameters: code1( str ) , code2( str )…
A: Hey there, I am writing the required solution of the questin mentioned above. Please do find the…
Q: 7. ax^2+ bx + c = 0 a,b,c are constants number entered by the user. Find roots for equation and…
A: 7. ax^2+ bx + c = 0 a,b,c are constants number entered by the user. Find roots forequation and…
Q: Python Functions for Statistical Applications 1A. Implementation with the standard def keyword…
A: SOLUTION - 1A. Implementation with the standard def keyword Here is the correct 1 line for the…
Q: C Program Functions with no Parameters and Return Values Create a program that accepts an…
A: Introduction: In this question, we are asked to complete a partial code snippet in C, we have to do…
Q: a) The formula that converts Celsius temperature to Fahrenheit is given below: F = 9/5*C + 32…
A: Python Program for a) # defining a function named convert_tempdef convert_temp(cel): #using for…
Q: 1/3 100% + Sum of odd integer numbers: In this problem, you are going to read a series of integer…
A: Coded using Python 3.
Q: N.B: Use all the recursive functions in one C++ code 1. Write a recursive function that returns the…
A: THE ALGORITHM OF THE CODE:- 1. Start.2. Declare and define a function to calculate the nth Fibonacci…
Q: COMMON PREFIX Two strings s1, s2 are passed as a parameter to the given function. Return the largest…
A: Write the CPP code of the function commonPrefix that takes two strings s1, s2 as a parameter to the…
Q: ASSIGNMENT: Write a program to use the capability of Recursion to calculate factorials. For example,…
A: in java import java.util.Scanner;public class Factorial { public static void main(String[]…
Q: Write a menu-driven program (repeating or non-repeating) that displays four choices to the user to…
A: logic:- use while True loop to pop up menu use if elif else to match user input operation. In…
Q: Complete the code for this recursive function. def fib(n): if n == 1: return 0 if n == 2: return 1…
A: Introduction: - Here is asking to complete the code, that will need to fill in the two blank that…
Q: Function Name: commonTimeZones() Parameters: code1( str), code2( str) Returns: list of common time…
A: Hey there, I am writing the required solution of the questin mentioned above. Please do find the…
Q: Which of the following is the termination condition in the following recursive function, assuming N…
A: Question Which of the following is the termination condition in the following recursive function,…
Q: Design a function that accepts an integer argument and returns the sum of all the integers from 1 up…
A: def SumOfNumbers(n): if n <= 1: return n return n + SumOfNumbers(n - 1) n =…
Q: Write a CPP program to do the following using recursion:
A: Answer // C++ program to calculate population // using recursion…
Q: python Write a function which accepts two sequences of numbers from the user, each number separated…
A: Step 1: Define a function findCommon() that prompts and accepts two sequence of numbers from the…
Q: a) Find names and surnames of professors who teach a course in the "Biology" program: π(first_name,…
A: We have to retrieve particular data from a database that has information on instructors, students,…
Q: In C language / Please don't use (sprint) function. Write a function fact_calc that takes a string…
A: In this question we have to write a C program to print the factorial of the number as provide…
Q: Write the in_order() function, which has a list of integers as a parameter, and returns True if the…
A: Question given: A list of integer numbers is given. Define a method that check if all integers in…
Step by step
Solved in 2 steps with 1 images
- Write VBA CODE FOR THE FOLLOWING PROBLEM Problem: The Worksheet named Grades contains a place for students to record the grades they have received in their classes. Students put the number of each letter grade received in the B column. (For example, the worksheet currently shows that the student has taken 9 classes and made five As, one B, one C, one D, and one F as grades. You need to write a program that reads the grades from the worksheet and uses a function to calculate the student’s GPA. For this problem you can assume that all classes are worth the same number of credit hours. The function should send back the GPA to the calling procedure. The procedure will then put up a message box that gives the student their GPA and a message about their GPA, all in one message box. The message should be “You qualify for an internship” if the student has a GPA of at least 3.0. It should be “You’re in the danger zone” if the GPA is between 2.0 and 3.0. And it should be “You are on…Summarize the machine cycle in a few short sentences.plaese code in python You are tasked with creating a square grid of values in which each value only appears once in each column and once in each row (think like a Sudoku). Write a function called grid that inputs a list and outputs a square grid of values of that list in which each value only appears once in each column and once in each row. Specifically, one in which each row is the one above it shifted by one item. Your answer should be in the form of a list of lists, where each sub-list is a row of the square. For example: grid([1, 2, 3, 4]) -> [[1, 2, 3, 4], [4, 1, 2, 3], [3, 4, 1, 2], [2, 3, 4, 1]]
- Write a recursive function that parses a hex number as a string into a decimal integer. The function header is: int hexToDecimal(const string& hexString) Write a test program that prompts the user to enter a hex string and displays its decimal equivalent.1. Given a list of N (N>=100) distinct integers in unsorted order, write a C or C++ or Java program to find the integer in the list that is greater than exactly 43% of the integers in the list. If N*0.43 is not exactly an integer, then take the floor. For example, if N=120, then the desired integer should be greater than exactly 51 of the integers in the list since 120*0.43=51.6. Find the integer without sorting the entire list. The input integers should be retrieved through stdin. Do not use any library classes or functions if they can achieve this functionality directly. Implement the algorithm and logic with your own code. You can add a sorting method to verify that your result is correct. However, if your program finds the desired integer through sorting alone, you will get at most half the credit. When testing, you can first create a text file storing the N unsorted integers (e.g. one integer per line) and then use standard input redirection. Some sample runs can look like the…JAVA CODE PLEASE Recursive Functions Quiz by CodeChum Admin Create a recursive function named sequence that accepts an integer n. This function prints the first n numbers of the Fibonacci Sequence separated by a space in one line Fibonacci Sequence is a series of numbers in which each number is the sum of the two preceding numbers. In the main function, write a program that accepts an integer input. Call the sequence function by passing the inputted integer. Input 1. One line containing an integer Output Enter·a·number:·5 0·1·1·2·3
- Q#8, Recursive letter: Given the following recursive function: 1 def love_letter(n):2 ifn<1:3 print('I Love CS5001 - Yes I do!!!') 4 else: 5 print('Roses are Red, Violets are Blue') 6 love_letter(n - 1) Identify the code lines that contain the base case and describe its purpose How would you modify this code to produce infinite recursion? Write a version of this code that will run forever and/or generate a RecursionError while still printing each message from line 3 and 5 at least once.1. Write a python program called a2_q1.py that asks the user (business owner) for their product information and creates an electronic list (e-list) of items. In part-2 of this assignment, customers should be able to use this e-list to purchase multiple products of varying quantities while products are available in stock.Your program should start by asking the business owner’s name (string) and the name of the company (string). Next, it should ask for three (3) product names (strings), their unit prices (floats), and the total number of products in stock (ints). Finally, it should display the list of items. Note: users are always allowed to enter any type of data when asked for input. Your program must always verify the user input. Invalid input should be handled with suitable error messages for each type of invalid input and the prompt should be repeated. To keep things simple, we will consider that when prompted a user can enter either an integer, a string, or a float (i.e., not a…7. Write a function that evaluates the area of a pentagon. Use "math.pi", for pi, and "math.sqrt" for square root. Write the solution on the space provided below. You do not need to run the code. DII 3.2 (Geometry: area of a pentagon) Write a program that prompts the user to enter the length from the center of a pentagon to a vertex and computes the area of the pen- tagon, as shown in the following figure. 3√3 2 The formula for computing the area of a pentagon is Area -s², where s is TT the length of a side. The side can be computed using the formula s = 2r sin 5 = where r is the length from the center of a pentagon to a vertex. Here is a sample run:
- Python EXERCISE 1. GENERATING AND PLOTTING A FUNCTION 1. Generate a list or ndarray of values from 0 to 4 with a spacing of 0.1 2. Calculate and plot the function x²-x² 635 025 020 015 630 005 0:00 00 laProgram language: Python Prompt: create a function that given a genre and a rating_range (i.e. [1.5, 3]), returns all the movies of that genre and within that rating range sorted by average rating. demonstrate that your function works. mock dataset: UserID MovieID Rating Genre Title Year 1 111 5 Drama Greyhound 2021 2 121 3.5 Drama After We Collide 2021 3 134 2.1 Crime The Little Things 2021 4 546 1 Drama After We Collide 2021 5 1113 5 Drama After We Collide 2021C++ Program Write a CPP program to do the following using recursion: 1. Using the current estimated population of 7.7 Billion and an estimated growth rate of 1.06%, compute the estimated year when the population year could exceed over 20 Billion. 2. Display the year (2xxx) and estimated population values for each year as you do this processing. 3. Start with the current year and display the data in ascending order. I am specifying this as it is possible to report this in descending order if the display is done after the recursion. For this assignment, create a method that calls itself recursively, passing the year and current population to itself. You can increase the population by applying * 1.0106 to increase by 1.06%. This method can return void and thus should do all the displays and computations needed. Display the year processed and estimated population value.. The variable for the population should be a double data type. Do not allow the display to be in scientific…