For the purposes of this question, if you have a pet of a certain type, that pet needs food, treats, a bed and a house -- but multiple animals of the same kind can share. This function takes what kind of animal or animals you have and returns a shopping list for your pet or pets.
Q: A student record is represented as a tuple consisting of (student's matriculation number, student…
A: You are too close with your code but you need to return only if no record is matching but your code…
Q: Using C/C++ programming language, 1. Write a program that will read 5 mobile’s information from the…
A: Given: 1. Write a program that will read 5 mobile’s information from the user and save it in a file…
Q: Consider using the enumerate function to achieve this. I realise that there are no emails within…
A: According to your requirements PYTHON CODE is mentioned below
Q: Given a variable that contains mixed collection types, update the provided function to display the…
A: We have provided sample according to names in course dictionary in main
Q: 5. In main(), using the monthly payment that you just calculated, call a function to create an…
A: A loan amortisation schedule is a detailed table of periodic loan payments that shows the amount of…
Q: Problem B. Counting Glorious Create another function count_glorious(low, high) that takes in two…
A: According to the Question below the Solution: Output:
Q: • Write a function that takes three integer pointer as parameters and calculates sum of all numbers.…
A:
Q: Using the code below, answer the following questions: 1) What are each of the 3 functions…
A: NOTE - As per our guidelines we are supposed to answer only the first three parts, please re-submit…
Q: cepts the vector of pointers to PurchaseOrder objects. It will go through that list and remove all…
A: According to the Question below the solution: Output:
Q: For question 4 in this lab, you wrote a program that prompted the user to enter a comma separated…
A: Find Your Code Below
Q: calculate(tokens): Takes one list of tokens as input corresponding to a mathematical equation. The…
A: code : - def calculate(li): try: # create new answer list ans = [] # find…
Q: • calculate(tokens): Takes one list of tokens as input corresponding to a mathematical equation. The…
A: calculate( tokens): Takes one list of tokens as input corresponding to a mathematical equation. The…
Q: Write a function called set_plan(), which accepts, a string for a plan name, an integer for goal…
A: The function is given below - void set_plan(string name, int calories, Exercise_plan* p) {…
Q: Please explain why it is better to utilize user-defined functions rather than pre-defined ones.
A: 1. User defined functions are created by user according to their requirements. 2. User defined…
Q: Given a variable that contains mixed collection types, update the provided function to display the…
A: The program is given below:- def reformat_instructor(instructor): l= instructor.split(" ") #this…
Q: Write a function named "containsigh BoolVariable object pointers and a search string. It will return…
A: Actually, program is a executable software that runs on a computer.
Q: Write a C++ program that creates a list of 10 cars. Each car has the following information: 1.…
A: C++ is a object oriented computer language which can be used to create high performance applications…
Q: Explain how the background process of calling inline functions varies from that of a regular…
A: Given: A function is a chunk of structured code that is used to carry out a single specific…
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: Consider the list:((name (number1 nation)) (MusicPurchasedNorway) (Pressfreedom Norway)…
A: Please check the step 2 for solution
Q: Given the following list, write functions to generate the list comprehensions that would produce the…
A: 1) Below is python program that defines function to generate new lists or touples using list…
Q: Create a function using currying that will add a car maker name as a property to the carLot object…
A: In this problem, we need to design the code in the java Script programming language. Input -…
Q: W
A: Coded using Python 3.
Q: Write a program that creates a list of 10 cars. Each car has the following information:…
A: In Question Language not mention so i am using Python In Step 2 Complete Python Program
Q: Given a variable that contains mixed collection types, update the provided function to display the…
A: python code: def reformat_instructor(instructor): l=instructor.split(" ") #this function returns a…
Q: C++) Q1) Write your answer very precisely. What is friend function and why they are needed?
A: As e know private members cannot be accessed from outside the class and a non-member function cannot…
Q: Write a program that creates a list of 10 cars. Each car has the following information: 1.…
A: Programming language not mention in Question so i am using python For this program Complete program…
Q: earlier_name Complete the following function according to its docstring description. 1 def…
A: Here have to determine sort name alphabetically.
Q: Language: JAVA Script write a function called 'dynamicAdder (num). The dynamicAdder function will…
A:
Q: Write a function called findavg that takes a pointer to a struct student as input and will return…
A: Answer is given below-
Q: There should be an explanation of the GetConsoleTitle function.
A: We need to define the term:- GetConsoleTitle function:- This is used to retrieve the title of the…
Q: This challenge is based on the classic videogame "Snake". Assume the game screen is an n *n square,…
A: In this problem, we need to design the code in the Python programming language. Input - Integer…
Q: Find the Median without the High and Low Write a function MedianWithoutHL(ScoreList) that takes an…
A: The required Python code is given below: def MedianWithoutHL(ScoreList): # method to takes an…
Q: get_total_cases() takes the a 2D-list (similar to database) and an integer x from this set {0, 1, 2}…
A: Coded using Python 3.
Q: i am writing a code in python in order to create an employee management application for a fictional…
A: You can change the print method in your Employee class to __str__ like so: # Get each object def…
Q: (cons '(1 5) '(2 3)) (list 3 '(1 2)) (list '(1 5) '(2 3)) (append '(1) '(2 3))
A: Please execute the following statements. Write down the return value for each statement and explain…
Q: 1. Your program must implement all the functions (load_contact_list and the helper functions) listed…
A: CODE:- def load_contact_list(filename): contact_list={} with open(filename,'r') as f:…
Q: Define a function called final_grades () that accepts dictionary_students as its only parameter. The…
A: The python3 code is given below: def final_grades(dictionary_students):…
Q: define the following function: 1. This function must add a task to a checklist, setting its…
A: Algorithm/Program Plan: Create a function addTask() that accepts two parameters checklist and key…
Q: i want to create a c++ function using linked list, that update employee record, the record…
A: We will make a structure and linked list to deploy the above scenario.
Q: Questions P17 and P18 are related to the code skeleton of the function below. The function…
A: Read Dictionary From File in Python:- A Dictionary in Python is collection of key-value pairs, where…
Q: ividual variables are particularly well suited for storing and processing lists of data.
A: Required: Is this statement true or false? Individual variables are particularly well suited for…
Q: A student has a number of attributes including: stName, stNo and stMark If we have a LIST of 4…
A: we have to write a program where it will accept 4 students and find out the student name and marks…
Q: This challenge is based on the classic videogame "Snake". Assume the game screen is an n *n square,…
A: Algorithm - Take input from the user. Now use the below logic - res = 1 count = 0 while…
Q: What is the result of this function Len("collage") * 7
A: 7
Q: C++ language Write a program that creates a list of 10 cars. Each car has the following…
A: C++ language is a direct descendant of C programming language with additional features such as type…
Q: write program by oop c++ for 5 item One of your colleagues has started to a new project, which is a…
A: The program is written in C++ #include <iostream> #include<string>…
Q: ticket_price 이6 Complete the following function according to its docstring description. 1 bef…
A: I have given the completed code below.
For the purposes of this question, if you have a pet of a certain type, that pet needs food, treats, a bed and a house -- but multiple animals of the same kind can share. This function takes what kind of animal or animals you have and returns a shopping list for your pet or pets.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images
- Question 9 Not complete Marked out of 1.00 Flag question A unique bid auction accepts an unlimited number of bids from many customers (each of whom pay a small amount to place each bid), and the winning bid is the lowest bid which is submitted by just one person (i.e. the lowest unique bid). Define a function called winning_bid (bids_list) which takes as input the list of all bids that have been made in the auction. The value returned by your function should be the lowest unique bid. If there is no lowest unique bid (in other words, if all bids appear more than once) then the function should return -1. For example, given the following bids: [3, 7, 5, 6, 3, 4, 8, 4, 5, 8, 12, 11] the winning bid is 6 as it is the lowest unique bid (because 3, 4 and 5 all appear more than once in the list of bids). For example: Test print (winning_bid([1, 2, 3, 4, 5])) print (winning_bid([1, 2, 1, 4, 5])) print(winning_bid([1, 2, 1, 2, 5])) print(winning_bid([1, 1, 1, 4, 1])) Result 1 2 5 44. pet_shopping_list For the purposes of this question, if you have a pet of a certain type, that pet needs food, treats, a bed and a house -- but multiple animals of the same kind can share. This function takes what kind of animal or animals you have and returns a shopping list for your pet or pets. PLAN FOR THIS FUNCTION: determine the word for a single kind of the animal. if the input is "mice", then we want the output to contain "mouse" (don't worry about any other unusual plurals). Otherwise, look for words that end with "es" and remove the final "es", so "foxes" goes to "fox". Otherwise, remove a final "s". Otherwise, assume that the word is singular. build and return a shopping list, which will be a list of strings. shopping lists should be in the shape: ["mouse food", "mouse treats", "mouse bed", "mouse house"] Sample calls should look like: >>> pet_shopping_list("mice")['mouse food', 'mouse treats', 'mouse bed', 'mouse house']>>>…/courses/46018/assignments/296094 >>> sum_of_greatest two(3, 100.900) 1000 4. pet_shopping_list For the purposes of this question, if you have a pet of a certain type, that pet needs food, treats, a bed and a house -- but multiple animals of the same kind can share. This function takes what kind of animal or animals you have and returns a shopping list for your pet or pets. PLAN FOR THIS FUNCTION: determine the word for a single kind of the animal. if the input is "mice", then we want the output to contain "mouse" (don't worry about any other unusual plurals). Otherwise, look for words that end with "es" and remove the final "es", so "foxes" goes to "fox". Otherwise, remove a final "s". Otherwise, assume that the word is singular. build and return a shopping list, which will be a list of strings. shopping lists should be in the shape: ["mouse food", "mouse treats", "mouse bed", "mouse house"] Sample calls should look like: >>> pet_shopping list("mice") I'mouse food', 'mouse treats',…
- Lab Activity 8: Functions Objectives: The objective of this Lab Assignment is to use functions. As you have learned already, the best approach to solve a problem is to break it down into individual steps. Do not forget about what you have previously learned and seen. This assignment will be asking you to use the knowledge you have acquired since the beginning of the semester. PART 1: Percentage of amino acid residues. Write a function that takes two arguments-a protein sequence and an amino acid residue code - and returns the percentage of the protein that the amino acid makes up. Test your function on the following examples: Sequence MSRSLLLRFLLFLLLLPPLP MSRSLLLRFLLFLLLLPPLP maralllrfllfllllpplp MSRSLLLRFLLFLLLLPPLP Amino acid residue M R L YThis Program should be done using C language Implement the Customer component following the requirements below using C Language... Requirements- Represent the Customers in your code using a 3D character array The maximum number of customers that can be saved is 128. Create a function list_customer which lists all customer data resembling the example run below. Create a function add_customer which prompts the user to input new customer information. Your code should check to make sure the customer does not already exist before adding it to the 3D array. Also check that the customer can be added based on the maximum number of customers in the system. Create a function get_customer which searches the customer data given an customer ID. If the customer exists, return the index within the data that the customer was found. Create a function find_customer which accepts a string containing the name of an customer to search for. It should return the index of the customer in the database. Each…Common Time Zones Function Name: commonTimeZones() Parameters: code1( str ) , code2( str ) Returns: list of common time zones ( list ) Description: You and your friend live in different countries, but you figure there's a chance that both of you might be in the same time zone. Thus, you want to find out the list of possible time zones that you and your friend could both be in. Given two country codes, write a function that returns a list of the time zones the two countries have in common. Be sure not to include any duplicate time zones. If the two country codes do not have any common time zones, return the string 'No Common Time Zones' instead. Note: You can assume that the codes will always be valid. example test cases: >>> commonTimeZones('can', 'usa') ['UTC-08:00', 'UTC-07:00', 'UTC-06:00', 'UTC-05:00', 'UTC-04:00'] >>> commonTimeZones('rus', 'chn') ['UTC+08:00'] For this assignment, use the REST countries API…
- Common Time Zones Function Name: commonTimeZones() Parameters: code1( str ), code2( str) Returns: list of common time zones ( list ) Description: You and your friend live in different countries, but you figure there's a chance that both of you might be in the same time zone. Thus, you want to find out the list of possible time zones that you and your friend could both be in. Given two country codes, write a function that returns a list of the time zones the two countries have in common. Be sure not to include any duplicate time zones. If the two country codes do not have any common time zones, return the string 'No Common Time Zones' instead. Note: You can assume that the codes will always be valid. example test cases: >>> commonTimeZones('can', 'usa') [UTC-08:00', 'UTC-07:00', 'UTC-06:00', 'UTC-05:00', 'UTC-04:00] >>> commonTimeZones('rus', 'chn') [UTC+08:00] For this assignment, use the REST countries API (https://restcountries.com/#api-endpoints-v2). For all of your requests, make…PYTHON CODING This function takes a list of points and then returns a new list of points, which starts with the first point that was given in the list, and then followed by points closest to the start point. Here is the function that needs to be created: def solution_path(points) : # insert code here return path Please use any of the following function to develop the solution_path function Distance function - calculates the distance between two points def distance(p1, p2) : distance = sqrt (((p1 [0] - p2 [0]) **2) + ((p1 [1] - p2 [1]) **2)) return (distance) Find_closest function - calculates the closest point to the starting point def find_closest(start_point, remaining_points): closest_distance = 99999 for coordinate in remaining_points: dist = distance(start_point, coordinate) if(dist < closest_distance): closest_distance = dist closest_point = coordinate return closest_point Path_distance function -…Jupyter Notebook Fixed Income - Certicificate of Deposit (CD) - Compound Interest Schedule An interest-at-maturity CD earns interest at a compounding frequency, and pays principal plus all earned interest at maturity. Write a function, called CompoundInterestSchedule, that creates and returns a pandas DataFrame, where each row has: time (in years, an integer starting at 1), starting balance, interest earned, and ending balance, for an investment earning compoundedinterest. Use a for(or while) loop to create this table. The equation for theith year's ending balance is given by: Ei =Bi (1+r/f)f where: Ei is year i's ending balance Bi is year i's beginning balance (note: B1 is the amount of the initial investment (principal) r is the annual rate of interest (in decimal, e.g., 5% is .05) f is the number of times the interest rate compounds (times per year) The interest earned for a given year is Ei - Bi Note the term of the investment (in years) is not in the above equation; it is used…
- In this program, your task is to calculate average of grades and then display the final grade. Your tasks are as follows: Create a function called get_average() that takes a list containing grades of five subjects and calculates the average and returns it. Create a function called get_grade() that takes average of the five subjects from the get_average() function and displays the grade as per the table below:Launch Meeting - Zoc X S Launch Meeting Zoc X Is Everyone Really Equ x E Reading Response 6 OCh7: Oppression & Se x SThank you for downlc X s.ucsc.edu/courses/46018/assignments/294537 2. are_anagrams This function takes two strings and returns True if they are anagrams of one another, which is to say that they contain the same letters, possibly rearranged, ignoring spaces and case. You can assume that the two input strings contain only letters and spaces. Sample calls should look like this: >>> are_anagrams ("bimmy is my friend", "My Bird Fey Minims") True >>> are_anagrams ("bimmy is my friend", "hello everyone") False >>> are_anagrams ("internet anagram server", "I rearrangement servant") True >>> are_anagrams ("internet anagram server", "internet anagram server") True 3. find_movies_by_director 4:11 PM This function takes a list of tuples (representing movies) and a string (representing a name of a director) and returns a 65°F Sunny 11/2/2021 e searchProgramming Assignment III In this assignment you are required to be researching some sorting algorithms available and providing some basic description on each algorithm you find. Your grade will be relative based on the number of algorithms you can come up with and their respective specifications. I would be happy with 10 sorting algorithms with clear description and analysis. The following is the specification you need to provide on each algorithm: 1. The name of the algorithm 2. A small paragraph describing the operation of the algorithm 3. The code of the sorting function in the language you prefer (Java, C++, C, Python, C#,). 4. A testing code to run the sorting function using random arrays of sizes: 1000, 10000, 100000, and 1000000 elements. The code should calculate the execution runtime in nanoseconds for each array size sorted. 5. The theoretical O-Notation runtime of the algorithm After providing the above description on the algorithms you find, you are requested to summarize…