IN MAGICFS LANGUAGE The Fibonacci sequence begins like this: 0,1,1,2,3,5,8,13,21,... A number in the sequence is the sum of the previous two numbers in the sequence, with first two being 0 and 1. Implement a function named 'fibonacci' that expects a working value of an integer index, and returns the Fibonacci number at that position in the sequence. The index is zero-based. For instance, if given a value of 4, the function should return 3 because the sequence is 0, 1, 1, 2, 3, ... Use subroutines if necessary. Your answer will be evaluated for partial credit. Comments are encouraged.
Q: In the case of a Minimum spanning tree (MST), if we multiply each weight by the same constant…
A: Below I have provided a solution for the given question.
Q: Consider the following SQL Query: SELECT FNAME, DNAME FROM EMP AS E, DEPT AS D WHERE E.DNO =…
A: The SQL Tree finds the tree structure by resolving the query into sub parts and finding the tree…
Q: Examine the different information management strategies used by businesses.
A: With the number of information available at our fingertips increasing by the day, how organisations…
Q: It is important to have a strategic strategy in the event that information centers want to automate…
A: Automation is a type of technology that uses a variety of control systems to complete tasks with as…
Q: Make care to include the view layer, the data layer, alt frames, and loop frames while drawing the…
A: A multiplayer sequence diagram helps us grasp use case understandings in the logical or rational…
Q: The study of computers What exactly is stigmergy, then? Why is it that this kind of communication is…
A: Computer: A computer is a digital electronic machine that can be programmed to automatically…
Q: Consider the following systems specification. If the transaction has an exclusive lock on the…
A: The Correct Answer is :
Q: Contrast the four different approaches to sreuse and compare and contrast your findings.
A: Reuse is the use of previously developed software's built-in scripts and codes in the building of…
Q: What are the advantages of having servers automatically supplied and configured rather than doing it…
A: Advantages of providing and configuring servers automatically Time efficiency – Significant decrease…
Q: Create a html code of below pictures: Mije Marais Lodge Location: Location Here Hostel prices:…
A: Algorithm : 1. Start the HTML document by writing the document type declaration, head tag, and body…
Q: Contrast the four different approaches to sreuse and compare and contrast your findings
A: In this question we have to understand the different approaches to software reuse Let's understand
Q: The program written for binary search, calculates the midpoint of the span as mid: (Low + High)/2.…
A: The solution is given in the below step with explanation Solution:- mid = Low + (High - Low) / 2
Q: Investigate the various companies' approaches to using their information systems.
A: Information-Systems and Their Fundamentals: Information systems may help any business, whether it is…
Q: Using PSM, explain how the French supercomputer Jean Zay is built (the number of processors and the…
A: Jean Zayn is a 16,384-core Cray XT5 supercomputer. Gigabit Ethernet switch connects processor cores.…
Q: You are planning trip to South America and and are worried about your devices with private ke being…
A: Dear Student, The answer to your question is given below -
Q: 3. Write program that open the text file, read the content of it and prints it in console.
A: Below I have provided a program for the given question. Also, I have attached a screenshot of the…
Q: The Internet's expanding popularity is a testament to its importance as a platform for expressing…
A: Introduction: The Internet is the most sophisticated computer-to-computer network in the…
Q: Is there any way to offer a high-level overview of the compiler and elaborate on the significance of…
A: Simply said, testability refers to the range of how easily or challenging it is to test a system or…
Q: Please implement the square-and-multiply algorithm for fast modular exponentiation. Requirements:…
A: Answer is
Q: "Internet of Things" and "wireless revolution" imply what?
A: In this question we need to explain the terms Internet of things (IoT) and wireless revolution.
Q: Write a function that returns the area of the triangle formed by the vectors u-[2 3 4] and v=[1-3-1]…
A: Below I have provided a program for the given question. Also, I have attached a screenshot of the…
Q: What are the upsides and downfalls of doing an internal static analysis?
A: Advantages: At certain points in the code, it can find places where the code is weak. It can be done…
Q: For what reasons do you believe CMOS RAM is superior to alternative methods of storing configuration…
A: To be decided: Why do you suppose that, rather than using jumpers or switches, it is more common to…
Q: Can you tell me the downfalls of professional networking? Discuss the problems and any solutions you…
A: Even while servers, applications, and gadgets may be providing services that are operating properly…
Q: 1. A router receives a packet with destination address (222.186.114.16) Show how it finds the…
A: INTRODUCTION: A device known as a router can link many packet-switched networks or subnetworks to…
Q: // define ListNode elements specific for this type of list, indicating current, previous and next //…
A: I have written code below:
Q: More data is always better than less data when making a programming decision, but performance alone…
A: Deep/shallow binding makes sense when a procedure may be offered as an argument to a function. The…
Q: Please don't copy and paste
A: Below I have provided a program for the given question. Also, I have attached a screenshot of the…
Q: Please identify two possible benefits of cloud storage and two possible drawbacks of utilizing the…
A: Introduction: The term "the cloud" refers to a style of computer data storage known as "cloud…
Q: Write MATLAB codes for the below listed function definitions: a)
A: I have written MATLAB code for this below:
Q: Question Statement: Consider following scenario: Suppose ABC Company is providing facility of online…
A: Below I have provided a solution for the given question.
Q: In the below stack allocation, what is the current value of top after execution of the following…
A: Answer: we know that stack work on LIFO( last come first out) after line StackAllocatr m = new…
Q: from sys import argv def print_two(*args): arg1, arg2 = args print(f"arg1: {arg1}, arg2: {arg2}
A: Here The code given below is written in Python programming language. The output of the code is arg1:…
Q: There are a lot of considerations that must be made for a compiler to generate proper and efficient…
A: The High Level Language software is compiled into Assembly code using a compiler. First, a…
Q: Suppose you want to use Naive Bayes to perform document classification (binary clas- sification)…
A:
Q: Why is software engineering crucial in software creation?
A: Introduction: The branch of computer science known as software engineering focuses on the planning…
Q: Write a program that clears the screen, locates the cursor near the middle of the screen, prompts…
A: / program that clears the screen, /locates the cursor near the middle of the screen, /asks for your…
Q: The Internet is widely used as a platform for unrestricted expression of opinions, and its…
A: Internet is the best computer-to-computer network.Internet information is transferred over millions…
Q: The height of a tree is equal to the number of its nodes, thus how many nodes can there be in a…
A: Introduction: A binary tree of height 5 that is balanced, assuming a tree with a single node has a…
Q: in c++ create code that does the following(binary search tree) 1 void add(string); // add…
A: Here is a possible implementation of a binary search tree in C++ that includes the functions…
Q: Question 9 How many input lines are connected to a multiplexer if it has Four control signals: 2…
A: Multiplexer: A multiplexer (often abbreviated as "MUX") is a device that selects one of several…
Q: C++ Write Family tree - Build a data structure to store information about father, mother and…
A: Here is an example of how you could implement a data structure to store information about a family…
Q: Can you elaborate on the distinction between the bound and unbounded stacks?
A: 1. The process of creating a set of instructions that tells a computer how to perform a task is…
Q: Are there ways to distinguish between deadlock avoidance and deadlock prevention?
A: Introduction: Deadlock is a state that develops when a group of processes wait for resources that…
Q: Which kind of access control ensures that a user has just the data they need to do their task?
A: The answer that you are looking for is POOP. I will now go into more depth about it. The acronym…
Q: output A differs. See highlights below. Special character legen Input -Hello, 1 worlds! Your output…
A:
Q: pseudocode for a memoized dynamic programming algorithm forMysteryRecursion.
A: Your answer is :
Q: Where exactly does one make room for cloud computing within the larger framework and workings of an…
A: Introduction: Information moves quickly in both directions across cloud-based computer systems due…
Q: What exactly is meant by the term "cloud computing"?
A: A computer is a digital electronic machine that can be programmed to automatically perform a series…
Q: Does setting up a data center and stocking it with Windows or Linux servers have to be the only…
A: Introduction : A data center is a physical location where computer systems and related parts, like…
IN MAGICFS LANGUAGE
The Fibonacci sequence begins like this: 0,1,1,2,3,5,8,13,21,... A number in the sequence is the sum of the previous two numbers in the sequence, with first two being 0 and 1. Implement a function named 'fibonacci' that expects a working value of an integer index, and returns the Fibonacci number at that position in the sequence. The index is zero-based. For instance, if given a value of 4, the function should return 3 because the sequence is 0, 1, 1, 2, 3, ... Use subroutines if necessary. Your answer will be evaluated for partial credit. Comments are encouraged.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps
- A supermarket wants to reward its best customer of each day, showing the customer’s name on a screen in the supermarket. For that purpose, the customer’s purchase amount is stored in a list and the customer’s name is stored in a corresponding list. Implement a function nameOfBestCustomer that returns the name of the customer with the largest sale. def nameOfBestCustomer(sales, customers) Write a program that prompts the cashier to enter all prices and names, adds them to two lists, calls the function that you implemented, and displays the result. Use a price of 0 as a sentinel. Make sure that you use functions in your solution, including a main function.Write a function MedianWithoutHL(ScoreList) that takes an unsorted list of n numbers as a parameter, discards the highest and the lowest numbers and return the median. You can assume the number of items in the list is between 0.0 and 9.9. To find the median from a list of items, you have tosort the list and find out the value of the item in the middle.Note: If the list has an odd number of items, the median is the value of the middle item. If the list has an even number of items, the median is the average of the two middle items.Sample Run #1:scoreList1 = [9.0, 9.0, 7.5, 8.0, 9.5, 6.5, 5.0, 7.0, 7.5, 8.5]print("The Original ScoreList: ", scoreList1)print(MedianWithoutHL(scoreList1))Output of Sample Run #1:The Original ScoreList: [9.0, 9.0, 7.5, 8.0, 9.5, 6.5, 5.0, 7.0, 7.5, 8.5]The List after sorting: [5.0, 6.5, 7.0, 7.5, 7.5, 8.0, 8.5, 9.0, 9.0, 9.5]Without the High & Low: [6.5, 7.0, 7.5, 7.5, 8.0, 8.5, 9.0, 9.0]7.75Write a function that when given a URL as a string, parses out just the domain name and returns it as a string. Examples:domain_name("http://github.com/SaadBenn") == "github" domain_name("http://www.zombie-bites.com") == "zombie-bites"domain_name("https://www.cnet.com") == "cnet"Note: The idea is not to use any built-in libraries such as re (regular expression) or urlparse except .split() built-in function""" # Non pythonic waydef domain_name_1(url): #grab only the non http(s) part full_domain_name = url.split('//')[-1] #grab the actual one depending on the len of the list actual_domain = full_domain_name.split('.') # case when www is in the url if (len(actual_domain) > 2): return actual_domain[1] # case when www is not in the url return actual_domain[0] # pythonic one linerdef domain_name_2(url):
- In this problem, you have available to you a working version of the function round_up described in part (a). It is located in a module named foo. Using the given round_up function, write a function round_up_all that takes a list of integers and MODIFIES the list so that each number is replaced by the result of calling round_up_ on that number. For example, if you run the code, 1st = [43, 137, 99, 501, 300, 275] round_up_all(1st) print(1st) the list would contain the values [100, 200, 100, 600, 300, 300] Do not re-implement the round_up function, just import the food module and use it. Here is the code for the round_up function that can be imported using foo: def round_up(num): if num % 100 == 0 : #if number is complete divisible return num #return orginal num else: return num + (100-(num % 100)) #else add 100-remainder to num, if __name__ == '__main__': print(round_up(234)) print(round_up(465)) print(round_up(400)) print(round_up(89))Please answer it in Python Write a palindrome function that takes a word as an argument and returns a Boolean indicating whether the word is a palindrome. A palindrome is a word that remains the same when read from right to left instead of the usual order from left to right. Example: palindrome('here') is True but palindrome('go') is False. Write a function word_allows taking as an argument a word and a list of forbidden words, and returning True if the word is allowed, and False if the word is prohibited. Example: word_allows('fric', ['sous', 'fric', 'thune', 'ble']) is False word_allows('silver', ['sous', 'fric', 'thune', 'ble']) is truePlease answer it in Python Write a function last_consonant that takes as an argument a word and returns two return values: the index of its last consonant as well as the last consonant (as for lists, we will consider that the index of the first letter is zero). We will not deal with the problematic case where the word does not contain a consonant. Example: last_consonant('arrivee') returns 4, 'v' Write a function double_consonant that takes as an argument a word and has two return values: a Boolean worth True if the word contains a double consonant (twice the same consonant in a row), and in this case the second return value is the consonant that is doubled; If there is no doubled consonant, the function must return False and None. If the word contains several double consonants (for example, 'successor'), true will be returned and the first double consonant appearing in the word. Examples: double_consonant('arrive') is true, 'r'. double_consonant ('candy') is false, None…
- Write a function that is given a list of int id’s as a parameter, the id of the person looked for, and the length of the array. Use the data: Bob 123456 89 Suki 234567 77 Felix 345678 55 Julie 456789 67 The function searches the id array and returns the index of the id or –1 if the id does not exist. The main program outputs the name of the person at that index or a message that the person was not found. The name array (up to length number of students) and id array are declared in function main. Show all the declarations and the actual call. A sample run may look like the following: int SearchPerson(const int id[], int length,int who); Enter the id of the person 345678 That person is: Felix with a mark of 55 Enter the id of the person 444444 That person does not exist. in C++ please use basic coding I'm not…Write a function that takes two arguments, a list L1 and a list L2. • If the length of the list L1 is greater than twice the length of the list L2, then append the first three values of L1 to the three last values of L2. E.g. if L1 = ‘(1 2 3 4 5 6 7) and L2 = ‘(8 9 10), then return ‘(1 2 3 8 9 10) Should be written in the Racket programming languageWrite the following three functions in c programming language: a) The function gets an array A of length n of ints, and a boolean predicate pred. It returns the smallest index i such that pred(A[i])==true.If no such element is not found, the function returns -1.int find(int* A, int n, bool (*pred)(int)); b) The function gets an array A of length n of ints, and a function f. It applies f to each element of A.void map(int* A, int n, int (*f)(int)); c) The function gets an array A of length n of ints, and a function f. The function f gets 2 ints and works as follows: Start with accumulator = A[0] For i=1...length-1 compute accumulator=f(accumulator, A[i]) Return accumulator For example, if f computes the sum of the two inputs, then reduce() will compute the sum of the entire array.int reduce(int* A, int n, int (*f)(int,int));
- Write a function in C programming language that gets two ints x and y, and returns the sum of all ints between x and y, including them. int sum_interval(int x, int y); For example: - sum_interval(1, 4)returns 1+2+3+4=10. - sum_interval(10, 3)returns 3+4+5+6+7+8+9+10=52. - sum_interval(2, -1)returns (-1)+0+1+2=2. - sum_interval(-1, -1)returns -1. Note that we may have x>=y or x<=y. You may assume that the sum will be within the range of int.2. David is used to doing programming in Python and since the print() function in Python by default prints a newline after printing the string passed to the print() function. But in his current project, he is using PHP programming language and the echo function does not print a newline by default after the end of the string. So, he often misses giving a newline after printing a message. Help David by writing a function myecho() that takes a string as a parameter and also prints a newline after printing the string.Programming Language: C Write the following three functions: a) The function gets an array A of length n of ints, and a boolean predicate pred. It returns the smallest index i such that pred(A[i])==true. If no such element is not found, the function returns -1. int find(int* A, int n, bool (*pred)(int)); b) The function gets an array A of length n of ints, and a function f. It applies f to each element of A. void map(int* A, int n, int (*f)(int)); c) The function gets an array A of length n of ints, and a function f. The function f gets 2 ints and works as follows: 1. Start with accumulator = A[0] 2. For i=1...length-1 compute accumulator=f(accumulator, A[i]) 3. Return accumulator For example, if f computes the sum of the two inputs, then reduce() will compute the sum of the entire array. int reduce(int* A, int n, int (*f)(int,int)); Test for the functions: // used for test Q3-find bool is_even(int x) { return x%2 == 0; } bool is_positive(int x) { return x>0; } void…