Write a function averageB in Python that has a parameter scoreDict which is a dictionary where the keys are strings and the values are floating point numbers representing scores. The function returns the average score for all keys that start with a b (uppercase or lowercase) or returns 0 if there are no keys that start with b.
Q: write the code for this function Otur_process_s *otur_select(Otur_schedule_s *schedule) {}
A: The objective of the question is to write a function that selects the best process from a scheduling…
Q: [1 Given the Hill cipher's encryption key, k = [3] d determine the corresponding decryption key.…
A: Lester S. Hill invented the Hill cipher in 1929.Encryption formula:C = (K * P) mod 26Decryption…
Q: What is the Document Object Model?
A: The Document Object Model (DOM) is a programming interface for web documents. It represents the…
Q: Im trying to solve this question manually and using basic excel( without using visual basic) but all…
A: When facing challenges in solving a problem manually or through basic Excel, obtaining unexpected…
Q: Objectives Develop questions to gain further insight and help get the client and tester on the same…
A: You were given a Request For Proposal (RFP) but it seems to be lacking enough details to determine…
Q: Java program:; User's name. Write a program that prompts for and reads the user's first and last…
A: Initialize Scanner and Variables: Create a `Scanner` object for user input. Declare variables for…
Q: The following equation can be used to compute values of y as a function of x: y=be¯ªsin(bx)…
A: The objective of the question is to compute the values of y and z using the given equations and…
Q: Develop a Java program for managing a list of courses stored in a file named "Courses.txt." The…
A: Initialize TreeMap for courses.Open "Courses.txt."For each line:Split into parts.If parts count is…
Q: Python Please Write a program which picks a pair of dice. If the sum of the rolled numbers is 10,…
A: 1. Import the 'random' module for simulating dice rolls.2. Define a function 'roll_dice()' to…
Q: 1. In a computer, what is a bus, and what does it connect to?
A: In computing, a bus serves as a communication channel connecting various hardware components,…
Q: Determine the number of permutations of 10 objects taken six at a time. Determine the number of…
A: Permutations and combinations are fundamental concepts in combinatorics, a branch of mathematics…
Q: Objectives: to design a good interface to do simple arithmetic, including a running sum to use named…
A: Algorithm for Calorie Counter Application:1. Initialize variables: - totalCaloriesConsumed = 0 -…
Q: 1.5 Each of the following languages is the complement of a simpler language. In each part, construct…
A: SOLUTION -A DFA (Deterministic Finite Automaton) is a mathematical model that is used in computer…
Q: What are the three levels of data abstraction? Explain in your own language.
A: Data abstraction is a concept in computer science and database management that involves hiding the…
Q: Give state diagrams of DFAs recognizing the following languages. In all parts, the alphabet is…
A: An empty state in a DFA implies no valid transitions or acceptances, recognizing the empty set and…
Q: What is the purpose and functionality of the HTTP method?
A: HTTP (Hypertext Transfer Protocol) is the foundation of data communication on the World Wide Web. It…
Q: I am to write a python program using classes and objects to get the diameter, area, and perimeter of…
A: 1. Create a Circle class with an initializer (__init__) that takes parameters for the radius and…
Q: n class, we developed pseudocode for a DFA evaluator: string alpha = "a b c"; int state_cnt = 4;…
A: In this question we have to implement the C++ program to read the DFA from a file and verify if…
Q: in java Integer valueIn is read from input. Write a while loop that iterates until valueIn is…
A: The objective of the question is to write a Java program that reads an integer from the input,…
Q: What is the use of validation? Explain different types of validation.
A: Validation is a critical process in data management, software development, and various other fields…
Q: Write code that iterates while userNum is less than 12. Each iteration: Put userNum to output. Then,…
A: The objective of the question is to write a program that iterates while a variable 'userNum' is less…
Q: What Are Data Models?What are the categories Of Data Models?
A: Data models are conceptual tools used to represent the structure and organization of data within a…
Q: a. {w w has at least three a's and at least two b's} b. {w w has exactly two a's and at least two…
A: SOLUTION-For this problem, construct DFAs for the simpler languages and then combine them using the…
Q: I am to write a python function Given a list of integers L and an integer n, then compute the sum of…
A: I have provided PYTHON CODE along with CODE SCREENSHOT and OUTPUT SCREENSHOT...
Q: You are helping a small business to collect and calculate weekly pay for its employees. Your java…
A: The provided Java program is designed to facilitate a small business in managing payroll for its…
Q: in java String inputWord is read from input. Write a while loop that iterates until inputWord is…
A: The objective of the question is to write a Java program that reads a string and an integer from the…
Q: Question 2 Which of the following Gnutella messages is reverse - routed? Ping Take Pull QueryHit
A: Users can transfer files directly over the Internet to one another using the decentralized…
Q: What are the main four components of a CPU?
A: The central processing unit (CPU) is the primary component of a computer responsible for executing…
Q: I have the following code in java, replit: //First class public class Main { public static…
A: This Java program represents a simple number guessing game with persistent player statistics. It…
Q: in java Strings itemToFind and inputItem are read from input. Integer wordCount is initialized with…
A: The objective of the question is to write a Java program that reads strings from the input until the…
Q: 1.16 Direct memory access is used for high-speed I/O devices in order to avoid increasing the CPU's…
A: Memory acts as a storage device, and it is used to capture, process, and store the data that can be…
Q: For the following algorithms given in pseudocode, describe what each algorithm does.
A: Consider the given pseudocode : Begin S :=0 For k = 1 to n do S:= S + 1 / k Output…
Q: Topic : how computer technology has changed business Create a comprehensive 10-slide presentation…
A: What: Overview of Computer Technology in BusinessIntroduction to the transformative role of computer…
Q: How does the distinction between kernel mode and user mode function as a rudimentary form of…
A: Here are brief introduction about both modes...Kernel Mode:The kernel is the center program on which…
Q: Consider the following recursive definition of 4-PERMUTATION: Rule 1: 4321 is a 4-PERMUTATION.…
A: A recursive definition is a way of describing a set or language by defining its elements in terms of…
Q: For the following regular expressions over the alphabet Σ ={a, b}, give a word description of the…
A: Regular expressions are powerful tools in computer science and formal language theory for describing…
Q: 1. PART (40%): Evaluation and optimization: A schema of the ski shop information system is given:…
A: A mathematical framework for expressing and working with relationships inside of databases is called…
Q: Pls help with this Lab. Thnks
A: The objective of the question is to create three different classes in Java: Pair, Cat, and…
Q: Keeping in mind the various definitions of operating system, consider whether the operating system…
A: The inclusion of applications such as web browsers and mail programs within an operating system…
Q: x Suppose in the year 2102 that evaluating 0.72 for an input parameter x becomes an important…
A: Following is the algorithm of the code :=To represent the f_p72 instruction, define the function…
Q: ### welcome_assignment_answers ### Input - All nine questions given in the assignment. ### Output -…
A: The provided Python script is designed to answer a series of questions related to fundamental…
Q: Use the Internet to review at least two news articles or publications about current and future…
A: In the rapidly evolving landscape of information technology, the choice of database management…
Q: 1.17 Some computer systems do not provide a privileged mode of operation in hardware. Is it possible…
A: The presence or absence of a privileged mode in hardware architecture significantly influences the…
Q: What is the difference between centralized systems and distributed systems?
A: A centralized system, also known as a monolithic system, is a computing architecture where all…
Q: Write a Python program to display a string's index 0,1,2,6,7,8,12,13,14,18,19,20,... ( 3 on and 3…
A: Display Characters with a 3-on, 3-off Pattern1. Input: Accept the input string.2. Initialize: Set…
Q: QUESTION 1: The mathematical equation that describes a cosine wave as a function of time (t) is…
A: In this question we are given two parts, The task is to plot the wave for two different frequencies…
Q: Python Please Write a program which picks a pair of dice. If the sum of the rolled numbers is 10,…
A: 1. Import Necessary Module: - Import the `random` module to generate random numbers.2. Define…
Q: 5) Approximation and error It is known that: cos (x) = (-1)kx²k (2k)! k=0 Truncate the series to…
A: In this question we have to write a MATLAB Code for the approximation and error for the given series…
Q: placeholder for the Tile objects. But not all the spots are necessarily occupied. When the block is…
A: A Java implementation for managing blocks of tiles. The `Block` class provides functionality to…
Q: What is sentiment analysis? How does it relate to text mining?
A: Sentiment analysis, sometimes referred to as opinion mining, is a natural language processing (NLP)…
Write a function averageB in Python that has a parameter scoreDict which is a dictionary where the keys are strings and the values are floating point numbers representing scores. The function returns the average score for all keys that start with a b (uppercase or lowercase) or returns 0 if there are no keys that start with b.
Step by step
Solved in 3 steps with 1 images
- Please answer it in Python write a function word_vers_dictionary(word), which takes a word (string) and returns the corresponding dictionary. For example: >>>word_vers_dictionary("tasses ") #return => {'a': 1, 's': 3, 'e': 1, 't': 1} Using the mot_vers_dictionnaire function, write a function is_anagramme(letters, word) that sends True if the string letters is an anagram of the word word, False otherwise. . For example : >>> is_anagramme("tusla", "hi") True >>> is_anagramme("salus", "salut") FalsePYTHON!!!! Write a function that takes a dictionary representing points in 3D space and an associated color for each point, and returns the centroid of the set of points in each color as another dictionary. The keys in the input dictionary are tuples representing the coordinates of points in 3D space and the values are strings representing colors. The keys in the resulting dictionary are colors, and the values are tuples representing the centroids. For example, the following is a valid input dictionary: dict1 = {(1,1,1):"red", (2,1,-1):"green", (0,-1,1):"red", (0,0,-2):"blue"} In this case, there are 2 red points, and their centroid is at ( (1+0)/2, (1-1)/2, (1+1)/2 ) = (0.5, 0, 1) Considering that in this example there is only one green and one blue point, they are representing the respective color's centroid. Hence, your function should return the following dictionary: {"red":(0.5,0.0,1.0), "green":(2.0,1.0,-1.0), "blue":(0.0,0.0,-2.0)} Note that, there is no restriction on the…Write a function piggyBank in Python that accepts a sequence of "coins" and returns counts of the coins and the total value of the bank. the coins will be given by a list of single characters, each one of 'Q','D','N',P', representing quarter, dime, nickel, penny the function returns a tuple with two items:1. a dictionary with counts of each denomination. They should always be listed in theorder 'Q','D','N',P'2. the total value in whole cents of the amount in the bank Sample result examples: >>> piggyBank(['D', 'P', 'Q', 'Q', 'D', 'P', 'P'])({'Q': 2, 'D': 2, 'N': 0, 'P': 3}, 73) >>> piggyBank(['D', 'D', 'N', 'N', 'N'])({'Q': 0, 'D': 2, 'N': 3, 'P': 0}, 35) >>> piggyBank(['P', 'D', 'N', 'P', 'N', 'N', 'N', 'Q', 'D', 'P', 'Q', 'Q', 'D'])({'Q': 3, 'D': 3, 'N': 4, 'P': 3}, 128) >>> piggyBank(['D', 'P', 'Q', 'Q', 'D', 'P', 'P'])==({'Q': 2, 'D': 2, 'N': 0,'P': 3}, 73)True Please only give to me the final code or "tool" that could generate any of the…
- Write a function in python, cannot use isalpha or .get named count_letters that takes as a parameter a string and returns a dictionary that tabulates how many of each letter is in that string. The string can contain characters other than letters, but only the letters should be counted. The string could even be the empty string (just ""). Lower-case and upper-case versions of a letter should be part of the same count. The keys of the dictionary should be upper-case letters. If a letter does not appear in the string, then it would not get added to the dictionary. For example, if the string is "AaBb" then the dictionary that is returned should contain these key-value pairs: {'A': 2, 'B': 2}Write a function named count_letters that takes as a parameter a string and returns a dictionary that tabulates how many of each letter is in that string. The string can contain characters other than letters, but only the letters should be counted. The string could even be the empty string (just ""). Lower-case and upper-case versions of a letter should be part of the same count. The keys of the dictionary should be upper-case letters. If a letter does not appear in the string, then it would not get added to the dictionary. For example, if the string is "AaBb" then the dictionary that is returned should contain these key-value pairs: {'A': 2, 'B': 2} And no, we haven't covered the isalpha() funciton or the .get function, so don't use it.Write a function that takes a dictionary representing points in 3D space and an associated color for each point, and returns the centroid of the set of points in each color as another dictionary. The keys in the input dictionary are tuples representing the coordinates of points in 3D space and the values are strings representing colors. The keys in the resulting dictionary are colors, and the values are tuples representing the centroids. For example, the following is a valid input dictionary: dict1 = {(1,1,1):"red", (2,1,-1):"green", (0,-1,1):"red", (0,0,-2):"blue"} In this case, there are 2 red points, and their centroid is at ( (1+0)/2, (1-1)/2, (1+1)/2 ) = (0.5, 0, 1) Considering that in this example there is only one green and one blue point, they are representing the respective color's centroid. Hence, your function should return the following dictionary: {"red":(0.5,0.0,1.0), "green":(2.0,1.0,-1.0), "blue":(0.0,0.0,-2.0)} Note that, there is no restriction on the number of…
- Write a function that takes a dictionary representing points in 3D space and an associated color for each point, and returns the centroid of the set of points in each color as another dictionary. The keys in the input dictionary are tuples representing the coordinates of points in 3D space and the values are strings representing colors. The keys in the resulting dictionary are colors, and the values are tuples representing the centroids. For example, the following is a valid input dictionary: dict1 = {(1,1,1):"red", (2,1,-1):"green", (0,-1,1):"red", (0,0,-2):"blue"} In this case, there are 2 red points, and their centroid is at ( (1+0)/2, (1-1)/2, (1+1)/2 ) = (0.5, 0, 1) Considering that in this example there is only one green and one blue point, they are representing the respective color's centroid. Hence, your function should return the following dictionary: {"red":(0.5,0.0,1.0), "green":(2.0,1.0,-1.0), "blue":(0.0,0.0,-2.0)} Note that, there is no restriction on the number of…Write a function that takes a dictionary representing points in 3D space and an associated color for each point, and returns the centroid of the set of points in each color as another dictionary. The keys in the input dictionary are tuples representing the coordinates of points in 3D space and the values are strings representing colors. The keys in the resulting dictionary are colors, and the values are tuples representing the centroids. For example, the following is a valid input dictionary: dict1 = {(1,1,1):"red", (2,1,-1):"green", (0,-1,1):"red", (0,0,-2):"blue"} In this case, there are 2 red points, and their centroid is at ( (1+0)/2, (1-1)/2, (1+1)/2 ) = (0.5, 0, 1) Considering that in this example there is only one green and one blue point, they are representing the respective color's centroid. Hence, your function should return the following dictionary: {"red":(0.5,0.0,1.0), "green":(2.0,1.0,-1.0), "blue":(0.0,0.0,-2.0)} Note that, there is no restriction on the number of…Write a python program... Write a function called safeAdd(d, k, v, unsafe=False) that takes either three or four input parameters when called. Here, d is a dictionary, k is a key and v is a value. The function will add the key:value pair k:v to the dictionary d if the key k is NOT in the dictionary.If the key is in the dictionary, the function will display the current value for that key, the new value you passed into the function and ask the user if they wish to proceed and overwrite the existing value.If the optional fourth parameter is True, then just add the key:value pair without checking if the key is already present.Sample run (user input is highlighted) >>> d = {'A':1}>>> safeAdd(d, 'B', 3}>>> display(d)A, 1B, 3>>> safeAdd(d, 'B', 2)The key B is already in the dictionary.Current value is 3. Do you want to replace this value with 2? [yes/no] yes>>> display(d)A, 1B, 2>>> safeAdd(d, 'A', 12)The key A is already in the…
- How to write a function in python 3 that takes two dictionaries b1 and b2 and returns a new dictionary b3 which is the combination of b1 and b2 such that the function adds values for common keys. Input: b1 = {'a':1,'b':10,'c':3} b2 = {'a':2,'b':11,'d':4} Output: b3 = {'a':3,'b':21,'c':3,'d':4}In python Decode a checkerboardDefine a function named decoder_damier that accepts as argument a checkerboard represented as a string, and returns a tuple (m,n,k) where m and n are respectively the number of rows and columns of the checkerboard, and k is a dictionary of the tokens that are on this checkerboard. A token is defined as any character other than '.', the latter symbolizing an empty checkerboard. The returned dictionary must contain key associations: value where the key is a couple (i,j) Row and column indices of the block of the token with a value symbol. For example, the following expression: decoder_damier('..A....... n.B........ nC......... n.......... n')must return the following tuple: (4, 10, {(0, 2): 'A', (1, 1): 'B', (2, 0): 'C'})That is, a checkerboard of 4 rows by 10 columns, with tokens A, B and C respectively in boxes (0.2) , (1.1) and (2.0). Note that your function must not make any display, only return the requested tuple. You can assume that the string…Write a python function called make_square that takes a tuple in the parameter as a range of numbers (starting point and ending point (included)). The function should return a dictionary with the numbers as keys and its squares as values.