YOUR TASK: Implement a function enc (msg: str, key: int) -> strthat takes a message string msg and a key key, 1< key
Q: Implement Playfair Cipher to get the ciphertext. Here, plaintext and key is given. Plaintext =…
A: Plaintext : "Fitness is the key" Since spaces are prohibited, assume plaintext to be :…
Q: Given what is supposed to be typed and what is actually typed, write a function that returns the…
A: function findBrokenKeys(str1, str2) { var brokenLetters = []; for (var i=0; i<str1.length; i++) {…
Q: Writing a Cipher
A: Coded using Python 3.
Q: Prompt the user to enter a string of their choosing (assume no punctuation). Store the text in a…
A: Since the Programming language is not mentioned in the question, we will answer this question in…
Q: Write a function larger_decrement (numlist, n) that takes two parameters, a list of integers…
A: larger_decrement Algorithm 1. Start2. Take two parameters as input: numlist, a list of integers, and…
Q: Develop a WCF-REST Web service that takes a string (without spaces) as a parameter and performs…
A: Two ways: Treat the number as a string so every digit is a char in the string. Use mod operation to…
Q: Write a function snake that takes an integer n and returns a string containing an ASCII-art snake…
A: #include <iostream> using namespace std;//creating functionstring snake(int n){ //create…
Q: 2. Write and test two functions, encode(text, key) and decode(code, key), that implement a…
A: #function that will encrypt the file contentdef encode (plainfilename, key): #declaring the…
Q: PYTHON!!! Implement a function insert_sorted, which will insert a string into its appropriate…
A: Note: list.sort(): if list is of strings then, it will sort them in alphabetical order.
Q: This is in c++ Given the MileageTrackerNode class, complete main() to insert nodes into a linked…
A:
Q: PYTHON • Make a function str_hashtag() that replaces the 1", 2nd, 3rd, 4", and 5" character in 5…
A: Python code for above : # required function def str_hashtag(words): j = 0 # replace…
Q: define a function f(x, v) that takes in two inputs, x and v, and returns…
A: Sample Response def f(c,v): if v==0: return (-x**3+5*x**2-8*x+4) else : return…
Q: During tough times like these, investment becomes more uncertain with more dangers. To solve it, we…
A: Coded using Python 3
Q: B. By determining whether each relation on the set A = {1,2,3,4} possesses the types of relation in…
A: R is reflexive if for all x A, xRx. R is symmetric if for all x,y A, if xRy, then yRx. R is…
Q: Let L be a language defined over {a,b}* and recognizable by a finite automaton. The language Reverse…
A: Hello Student, hope you are doing well, I will be trying my best to explain and fulfill your query.…
Q: Write a function public static int rep(LLNode head, T one, T two) which replaces every occurrence…
A: Assuming LLNode<T> has structure as follows: A) It has data part to store data B) It has…
Q: In this challenge you should repeat a specific given char x times. Create a function that takes a…
A: function repeat(character, number) { var str = ""; for(var i = 1; i <= number; i++) {…
Q: Can this be written in C programming and using strings and loops. Also can there be clear and…
A: I have provided C CODE along with CODE SCREENSHOT and 2 OUTPUT…
Q: Write a python program and add a function called add_matrix() to it. This function takes two 2-D…
A: In this question we need to implement a python function which returns the sum of two matrices.
Q: In C++, an int is in the range 0 to 65535. But what if we need to add larger integers? Compute the…
A: Given: In C++, an int is in the range 0 to 65535. But what if we need to add larger integers?…
Q: Implement a technique that compresses strings in a basic way by counting repeated characters. The…
A: Dear Student, The below code implements a function in Python as no language is mentioned, It takes a…
Q: Write a program to reverse the words of a string. Implement a function reverse () that reverses the…
A: Following is the C program that implements a function reverse which reverses the selected part of…
Q: //STORY TIME else { try { Scanner fsc = new Scanner(new File("story" + option +".txt"));…
A: dear student the step by step explanation is provided below
Q: Consider an input string TAM of letters ‘A’, ‘M’, and ‘T’. This string, which is given by the user,…
A: ALGORITHM:- Sort_TAM (TAMUK[]) start = 0, mid = 0, end = length(TAMUK) - 1 while mid <= end if…
Q: Given the mapping a = 1, b = 2, ... %3D z = 26, and an encoded message, count the number of ways it…
A: c++ language code is given in step 2.
Q: Write a function named repeat that accepts a string (as a char*) and a number of repetitions as…
A: Question Approach: Define the function repeat which takes character s1 and integer repetition as…
Q: Write a function in C++ "replaceVowels()" with no return value to replace all the vowels (A, E, I,…
A: The, code has given below;
Q: Develop a crawler that collects the email addresses in the visited web pages. You can write a…
A: Hey there, I am writing the required solution based on the above given question. Please do find the…
Q: In cryptography, a Caesar cipher is a method of encryption where each character is replaced by a…
A: Note: I use C program to write this program. C program: C is a programming language developed by…
Q: Write keyword-counting program with the definition of keytab. The main routine reads the input by…
A: As the programming language is not mentioned writting the program in python
Q: Implement the interface DictionaryInterface to create a class of glossaries. A glossary is a…
A: // here we are Define a package package test3; // Here we are import util library import…
Q: Develop a crawler that collects the email addresses in the visited web pages. You can write a…
A: Hey there, I am writing the required solution based on the above given question. Please do find the…
Q: a function public ABList both(ABList listOne, ABList listTwo)that creates and returns an ABList…
A: It is defined as a group of statements that together perform a task. You can divide up your code…
Q: • frame: takes in a short sentence (string with words separated by spaces) and returns a string that…
A: Algorithm: Start Read a string s Implement a method frame() which takes string s as argument…
Q: The actual conversion is implemented as a static function toRoman(int) in the class…
A: java code given below:
Q: ecret information out of an evil company. They have a list of names of their informants and spies…
A: The program provided below is about two functions: send() and receive(). The function send()…
Q: Given the MileageTrackerNode class, complete main() to insert nodes into a linked list (using the…
A: Program plan: Define Structure with miles, and dates. Create the nodes with head, current, and last…
Q: Write a program in PYTHON with a function max(L) which examines the argument list L, and returns the…
A: 1) Below is python program with a function max(L) which examines the argument list L, and returns…
Q: Write a function(in pyhton) that RECURSIVELY merges the characters in two given strings in…
A: Coded in Python 3.x, Following Recursion Principle. Follow the indentation according to the…
Q: Implement a function, countVowels, which takes in a string and counts the number of vowels that are…
A: We have to count both lower and upper case characters as well
Step by step
Solved in 3 steps with 2 images
- Example Input14 31 1 1 24 14 23 2Example Output432Implement the fix_capitalization() function. fix_capitalization() has a string parameter and returns an updated string, where lowercase letters at the beginning of sentences are replaced with uppercase letters. fix_capitalization() also returns the number of letters that have been capitalized. Call fix_capitalization() in the print_menu() function, and then output the edited string followed by the number of letters capitalized. Hint 1: Look up and use Python functions .islower() and .upper() to complete this task. Hint 2: Create an empty string and use string concatenation to make edits to the string. Ex: Number of letters capitalized: 2Implement the function counter which takes in a string of words message, and returns a dictionary where each key is a word in the message, and each value is the number of times that word is present in the original string. def counter (message): """ Returns a dictionary of each word in message mapped to the number of times it appears in the input string. >>> X = counter('to be or not to be') >>> x['to'] 2 >>> x ['be'] 2 >>> x['not'] 1 >>> y = counter('run forrest run') >>> y['run'] 2 >>> y['forrest'] |||||| word_list = message.split() "*** YOUR CODE HERE ***"
- it's erlang language, and try to use anonymous function in the body to determine "and " and "or " operator. But I can't run it, keep showing error. Please help fixWrite a function size_t lineLength (char* string) that returns the index of the first instance of \n in string. In other words, find the length of the first line of the string. You can be sure string will contain a '\n' before it ends. You may not use any string library functions. For example: Test Result printf("%zu\n", lineLength ("ABC\nDE")); 31. a.Palindromes Complete the function palindrome(String text). Return true if text is a palindrome; if the word is identical forward and backward. Otherwise, return false. Example: palindrome(“racecar”) == true palindrome(“kayaks”) == false See main() for more examples. You can use text.charAt(i) to find the character at index i of text. Use recursion. palindrome() should call itself. No loops allowed. b. Complete the function nestedBrackets(String s). This function should find properly nested brackets within s. Return true if brackets are opened and closed correctly, and false otherwise. Single pairs and nested pairs are valid. For example: z[z]z, [zz[zz]z], [z[[z]zzz]], zzzzz Incorrect pairings and multiple separate pairs are not valid. For example: zz[zz, ]zzz[, [zzz][z], [z[z][z]z] See main() for more examples. nestedBrackets() should call firstIndexOf() and lastIndexOf() to help you solve the problem. Use recursion. nestedBrackets() should call itself. No loops…
- Write a subroutine that takes a simple sentence in noun-verb-object form and parses the sentence into its different parts. For example, the sentence “Mary walked the dog” is parsed into this:Noun: MaryVerb: walkedObject: the dogThis function should work with both String objects and StringBuilder objects.Question 2: Encoding Cryptography is the study of trying to create secure information by obscuring the original message. One simple encryption method is to substitute letters from the original message with other letters. To make it harder to decrypt the hidden message, we may also remove clues such as the length of the words in the message and any punctuation or capitalization. Write a function encode that consumes a string message. The function produces a string which is encrypted according the following procedure: • Only the letters from the original message will be encrypted. Other characters such as spaces, punctuation, numeric digits, etc. are not included in the encrypted message at all. • The encrypted message will only contain uppercase letters. • Each letter will be replaced by the uppercase letter at the opposite end of the English alphabet. In other words, A or a will become z, B or b will become Y, C or c will become x, .., z or z will become A. • The encrypted message will…In Kotlin, Write a recursive function called myZip, with an expression body. MyZip takes two Lists and returns a List of Pairs in which each value may be any type (I suggest your start by thinking out how to represent this data type). The pairs consist of corresponding elements in the two lists (the first element of the first list and the first element of the second list, etc). The base case should be that either (or both) of the original lists has length 1, so that, if the lists have different length, the zipping stops when the first list runs out of values.
- Display the password from the main() function. Write a function replaceVowels() with no return value to replace all the vowels (A, E, I, O, U) that have been selected with a symbol from the list ($ % @# &). That is, A must be replaced by $, E replaced by %, I must be replaced by @, O replaced by #, and U must be replaced by &. The function receives the address of the first characters of the password string as parameter. Display the password agin from the main() function.Write a function, Decode() that can analyse a list of card numbers. The function is constructed as follows:The function receives the string list (as in Question 3.1) as parameter and returns no value to the calling statement.When this function executes the following should happen:Each card number in the list should be analysed in turn to extract the encoded information in the following format:0318241215528881: Was issued by Diner’s club in 2018. The card expires on 24/12. The card is linked to a Credit account with account number: 15528881.It may be assumed that any year (YY) refers to the years 2000+.The information for each card number must be stored in one string variable. The variable must then be sent to the WriteFile() function (see Question 3.3 below) so that the result can be saved. The process repeats until each card number in the list is sent to the WriteFile() function.Implement function rotate that takes a string argument s and an integer argument n, and rotates the string s to the left by n times. For example, the code char s[] = "systems"; rotate(s, 3); will change s into "temssys", while the code char t[] = "abcd"; rotate(t, 1); will change t into "bcda". Restrictions: printf and strlen are the ONLY C library functions that you can use in the implementation. void rotate(char *w, int j)