nacci sequence begins with 0 and then 1 follows. All subsequent values are the sum of the previous two, ex: 0, 1, 1, 2, 3, 5, 8, 13. Complete the fibonacci() function, which has an index n as parameter and returns the nth value in the sequence. Any negative index values should return -1.
Q: 2. Consider the following program: Winclude using namespace std; int main() cout << "Any…
A: Output: A. To print the text without any newline break, remove \n from everywhere from court…
Q: Q3: al Write a function file that converts temperature in degrees Fahrenheit (Fº) to degrees…
A: The answer for the above mentioned question is given in the following steps for your reference.
Q: Levenshtein distance is the minimum number of editing operations (insertions, deletions, or…
A: The Levenshtein distance (a.k.a edit distance) is a measure of similarity between two strings. It is…
Q: Write a C++ code to insert the following numbers in the Linked List. 5, 78, 45, 11, 89, 10, 78, 6,…
A: #include <iostream>#include <list>#include <iterator>#include <map>using…
Q: 3.27 LAB: Login name Write a program that creates a login name for a user, given the user's first…
A: The answer is given below.
Q: 11. Write code that reproduces the output shown below. In [11]: # Code Here In [12]: # DON'T WRITE…
A: In this question we have to write a python code to generate a array using numpy. Question 11. Write…
Q: 7.11 LAB: Print string in reverse Write a program that takes in a line of text as input, and outputs…
A: - We need to highlight the code to reverse a string till we get the letter d for the word done.
Q: Convert to binary - methods Write a program that takes in a positive integer as input, and outputs a…
A: import java.util.Scanner; public class LabProgram // the class { // user define…
Q: 11.11 LAB: Drawing a right side up triangle Write a recursive function called draw_triangle) that…
A: I have provided PYTHON CODE along with CODE SCREENSHOT and OUTPUT SCREENSHOTS------------
Q: 7.12 Write a program that simulates the control software for a "people mover" system, a set of…
A: The program is given N amount of trains and M amount of stations in a text file; followed by the…
Q: 7.12 LAB: Warm up: Parsing strings Prompt the user for a string that contains two strings…
A: Coded using Python 3.
Q: You are given some coins. You have to take some coins from the given coins such that the sum of the…
A: NOTE: You have not mentioned the programming language so I did in C++ In this question, you have to…
Q: 5) int x; x=10,20,30; cout<<x<<endl;
A: Coded using C++.
Q: 10 - In an examination, 500 students appeared. Out of these students, 38 % got A+ grade, 45 % got B+…
A: Program to find the number of students who got A+, B+ and the number of students who just passed.
Q: HW5-4) Write and test a function that fetches the next n characters from input (including blanks,…
A: Answer
Q: Q3: al Write a function file that converts temperature in degrees Fahrenheit (Fº) to degrees…
A: As I have read the guidelines I can provide answers to only 1 parts of the questions in case of…
Q: Q4: Write a program to sort the following list of numbers ascendingly. L=[15,6,8,19,10,17,7,22,5,14]
A: As you have not mentioned the coding language i am providing the solution in java: Code: public…
Q: 4.18 LAB: Exact change Write a program with total change amount as an integer input, and output the…
A: Given The answer is given below.
Q: Q1) A vector is given by x = [7,19,2,14,5,12,4,18,6,13]. Using conditional statements and loops,…
A: In this question we have to write a code for a vector where we need to separate the vector into two…
Q: Write a C++ code to insert the following numbers in the Linked List. 5, 78, 45, 11, 89, 10, 78, 6,…
A: Program: // Include necessary header files#include <iostream>using namespace std;//…
Q: 4 using namespace std; 6 int main() 7 { cout » euro; 14 cout « endl; 15 // Prompt user and read in a…
A: #include<string>using namespace std; int main(){ cout<<"Dollar to Euro Currency…
Q: 6.12) Since communications channels are often noisy, numerous ways have been devised to ensure…
A: the code is given below in c
Q: Q.5/ Write a program to enter two numbers and compute multiplication and division operations using…
A: Dim x, y, z As Single ' Description: Compute Multiplication & Division operationPrivate Sub…
Q: 16-Write a function called find_integer_with_most_divisors that receives a list of integers and…
A: Since the programming language is not specified in the question, so I am using python programming…
Q: 3.39 The computer game function collision() checks whether two circular objects col- lide; it…
A: To find collision of two circles we calculate distance between two centers and sum of two radius…
Q: Python 3.7.4 Write a statement that associates s with the empty set.
A: Set:A set is a list of unranked data items, in python data items can be added or removed in a…
Q: public class Turn{public static void main(String[] args){// Different initial values will be used…
A: Equations that are used to replace the value of variable x and y: - The initial values of the…
Q: python) 11. Create a function based on the following information: There is a list which contains…
A: We have to create a function based on the following information as given in the question: Function…
Q: 21.4 LAB: Parsing dates (Use Python) Write a program to read dates from input, one date per line.…
A: Here in the main block, I have created an infinite while loop. Next inside the loop, I have taken…
Q: Please answer in C++ Write a program that takes in a positive integer as input, and outputs a…
A: Let's solve the question step by step and understand the algorithm: 1. In the main function input a…
Q: Printing array elements separated by commas. Write a for loop to print all NUM_VALS elements of…
A: The given below program is in java
Q: 6.27 LAB: Multiples of ten in a list Write a program that reads a list of integers, and outputs…
A: def is_list_mult10(my_list): count = 0 n = len(my_list) for i in range(0, n): if…
Q: 01 - Multiplication Times Table Print a multiplication times table from 0 to a user entered number…
A: Answer in step2
Q: *4.11 (Convert an uppercase letter to lowercase) Write a program that prompts the user to enter an…
A: programming language is not mentioned so providing answer in C++ The logic that we are using here…
Q: using chapters 1 to 10 from the book C how to program edition 8
A: #include <stdio.h>union integer{ char c; short s; long b; int i;};int main(void){…
Q: 6.24 LAB: Convert to binary - functions Write a program that takes in a positive integer as input,…
A: Algorithm: According to the algorithm mentioned, function integer_to_reverse_binary is written and…
Q: A year in the modern Gregorian Calendar consists of 365 days. In reality, the earth takes longer to…
A: 1) Below is the python program that takes in a year and determines whether that year is a leap year…
Q: 5.2 Write a function in Javascript to take input a matrix as a parameter and returns whether the…
A: As per the given question we need to write a function : Input parameter : A matrix To check if the…
Q: PYTHON CODE: In order to beat AlphaZero, Grandmaster Hikaru is improving her chess calculation…
A: Required: In order to beat AlphaZero, Grandmaster Hikaru is improving her chess calculation…
Q: An acronym is a word formed from the initial letters of words in a set phrase. Write a program whose…
A: p[o] means first latter of every word split method convert sentence in to word like this so now we…
Q: 2. Let x be the first three digits of your matric number, AND y be the last three digits of your…
A: I am considering the matric number as 2210039 Now x = 221 and y - 039 we change 0 in y as 2 so, x =…
Q: 6.5 For each of the following write a. Create a list of the first 10 multiples of 13 (from 13 to…
A: Python program for list comprehension: # List comprehension of first 10 multiples of 13 multiples =…
Q: Q5. (a) Write a program to input a list of numbers in an array and then rearrange this array in such…
A: Introduction of the Program: The C program takes the size of the array from the user and then the…
Q: 5.14 For each of the following sets of integers, write a single statement that will print a number…
A: a) Program code: //import required data package import java.util.Random; //main class public…
Q: 6.26 LAB: Exact change - functions Write a program with total change amount as an integer input…
A: Given: 6.26 LAB: Exact change - functions Write a program with total change amount as an…
Q: 7. Write a function that evaluates the area of a pentagon. Use "math.pi", for pi, and "math.sqrt"…
A: code snippet:
Q: 7.12 Write a program that simulates the control software for a "people mover" system, a set of…
A: In this program given thar we have N number of trains and M number of stations in a text file;…
Q: 3. Write a JavaScript function to calculate the circumference of the circle, note that pi=3.14 and…
A: Actually, JavaScript is a programming language for the web.
Q: 15. Let C be the set of all Circles in the world, and S be the set of all Squares in the world. Vx E…
A: In questions with many questions, we must answer first one
6.32 LAB: Fibonacci sequence
The Fibonacci sequence begins with 0 and then 1 follows. All subsequent values are the sum of the previous two, ex: 0, 1, 1, 2, 3, 5, 8, 13. Complete the fibonacci() function, which has an index n as parameter and returns the nth value in the sequence. Any negative index values should return -1.
Ex: If the input is:
7
the output is:
fibonacci(7) is 13
Note: Use a for loop and DO NOT use recursion.
Use Python, please.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images
- Using Dr-Racket, what is the purpose of the number function?(define (number n)(local [(define (abstract int)(* int 11))] (build-list n abstract))) A) Create a list of the first n multiples of 11 starting at 11. B) Create a list of the first n multiples of 11 starting at 0. C) Create a list of the first n multiples of 11 starting at 1. D) Create a list of the first 11 multiples of n starting at 1. E) Create a list of the first 11 multiples of n starting at 0.F) Create a list of the first 11 multiples of n starting at n.Implement a password cracker using C++ Source code must be well documented (comments). You will be provided with an unsalted hashed password file that contains password hashes for different users. Also, you will be provided with a dictionary file(in clear text) containing the most common passwords. You should implement the offline dictionary attack by trying SHA1 and SHA2 algorithms. Also, your program should brute force all possible alphanumeric(only small cases) passwords from 1 to 4 characters using SHA1 and SHA2 algorithms against all hashed passwords left from the offline dictionary attack (if any).Project 2 Use Netbeans, to write a simple java program using the following data structures: 1. Stack by Linked List2. Circular Queue by Array The program should implement the following functions: 1. Insert2. Read/Print3. Remove an item4. Delete (the entire list) On the initial start of the program, users should be prompted for at least five elements into the list. After which they should be presented with options that will allow them to perform the functions defined above. Note that exception handling must be implemented. Screenshots of the cods as proof of its implementation should be included
- Implement a class representing a circular sorted linked list. The class must have the following requirements: The linked list and the nodes must be implemented as C++ templates First must point to the largest value in the list It must include a constructor, a destructor, a copy constructor and an operator= It must include functions to insert a given item, delete a given item, search for a given item, check if the list is empty, return the length of the list and print the list (from smallest to largest) Hint: Use the menu-driven program of the linked list to test all the functions in your class. Screenshot the output and make comments on each area on the program.The People class holds an unsorted list of humans. Initially, this list is empty. Existing Human objects may be added to the list using an insert method. Upon inserting a Human object, it is added to the array at the next available position and the position value in incremented. If the position value is equal to the size value, do not insert the Human. Instead, throw an exception that your driver can catch to print an error that the People object is full. Create a People class with the following features: Each People object has a statically allocated array of Human objects. Size attribute representing the maximum size of the array. Position attribute representing the next free position in the array. Default constructor with no arguments. Search method that takes a string argument and returns a Human object. This method returns the first Human object with a name matching the string argument. In other words, pass the name of a Human as a string, search the list of humans for…8.26 LAB: Word frequencies (dictionaries) Implement the build_dictionary() function to build a word frequency dictionary from a list of words. Ex: If the words list is: ["hey", "hi", "Mark", "hi", "mark"] the dictionary returned from calling build_dictionary(words) is: {'hey': 1, 'hi': 2, 'Mark': 1, 'mark': 1} Ex: If the words list is: ["zyBooks", "now", "zyBooks", "later", "zyBooks", "forever"] the dictionary returned from calling build_dictionary(words) is: {'zyBooks': 3, 'now': 1, 'later': 1, 'forever': 1} The main code builds the word list from an input string, calls build_dictionary() to build the dictionary, and displays the dictionary sorted by key value. Ex: If the input is: hey hi Mark hi mark the output is: Mark: 1 hey: 1 hi: 2 mark: 1 Use Python, please.
- 6.44 LAB: Contact list (JAVA) A contact list is a place where you can store a specific contact with other associated information such as a phone number, email address, birthday, etc. Write a program in java that first takes as input an integer N that represents the number of word pairs in the list to follow. Word pairs consist of a name and a phone number (both strings), separated by a comma. That list is followed by a name, and your program should output the phone number associated with that name. Output "None" if name is not found. Assume that the list will always contain less than 20 word pairs. Ex: If the input is: 3 Joe,123-5432 Linda,983-4123 Frank,867-5309 Frank the output is: 867-5309 Your program must define and call the following method. The return value of getPhoneNumber() is the phone number associated with the specific contact name.public static String getPhoneNumber(String[] nameArr, String[] phoneNumberArr, String contactName, int arraySize) Hint: Use two arrays: One for…1) When an allocator gets a request for nn bytes and finds a block of size mm, if m > nm>n then the block must be split. True or False 2) Coalescing refers to moving allocated blocks to create larger regions of free space. True or False 3) Segregated free lists divide blocks into different size classes, but some classes may contain more than one block size. True or False13.14 LAB: Library book sorting Two sorted lists have been created, one implemented using a linked list (LinkedListLibrary linkedListLibrary) and the other implemented using the built-in ArrayList class (ArrayListLibrary arrayListLibrary). Each list contains 100 books (title, ISBN number, author), sorted in ascending order by ISBN number. Complete main() by inserting a new book into each list using the respective LinkedListLibrary and ArrayListLibrary insertSorted() methods and outputting the number of operations the computer must perform to insert the new book. Each insertSorted() returns the number of operations the computer performs. Ex: If the input is: The Catcher in the Rye 9787543321724 J.D. Salinger the output is: Number of linked list operations: 1 Number of ArrayList operations: 1 Which list do you think will require the most operations? Why?
- 13.14 LAB: Library book sorting Two sorted lists have been created, one implemented using a linked list (LinkedListLibrary linkedListLibrary) and the other implemented using the built-in ArrayList class (ArrayListLibrary arrayListLibrary). Each list contains 100 books (title, ISBN number, author), sorted in ascending order by ISBN number. Complete main() by inserting a new book into each list using the respective LinkedListLibrary and ArrayListLibrary insertSorted() methods and outputting the number of operations the computer must perform to insert the new book. Each insertSorted() returns the number of operations the computer performs. Ex: If the input is: The Catcher in the Rye 9787543321724 J.D. Salinger the output is: Number of linked list operations: 1 Number of ArrayList operations: 1 Which list do you think will require the most operations? Why?…6.Need ri Write a JAVA program that will maintain a phone directory using a Linked-List. The program should be able to perform the following operations: Add persons details (first name, last name, phone number, city, address, sex and email) to the phone directory, where phone numbers in the directory have to be unique. (Note: each person record will store in one node in the linked-list and insert each person to the last) Delete any person details by a given phone number. Update telephone number by providing person first name. Display all details of persons from a phone directory. Search telephone number based on person first name. (Note: use sequential search to find all telephones for the given first name) Sort all persons in the phone directory ascending based on person first name. (Note: use bubble or selection sort to arrange the entire phone directory.6.28 In Python, Write a program that replaces words in a sentence. The input begins with word replacement pairs (original and replacement). The next line of input is the sentence where any word on the original list is replaced. Ex: If the input is: automobile car manufacturer maker children kids The automobile manufacturer recommends car seats for children if the automobile doesn't already have one. the output is: The car maker recommends car seats for kids if the car doesn't already have one. You can assume the original words are unique.