File "/Users/foramodedara/Desktop/i2p/assg3_219283662.py", line 17, in wordtomorse code += Mcode [ord(j)-97] KeyError: 0 Forams-MacBook-Pro:i2p foramodedara$ python3 assg3_219283662.py Traceback (most recent call last): File "/Users/foramodedara/Desktop/i2p/assg3_219283662.py", line 23, in print (wordtomorse(words)) File "/Users/foramodedara/Desktop/12p/assg3_219283662.py", line 13, in wordtomorse code + Mcode[ord(j)-97] TypeError: 'set' object is not subscriptable
Q: Add the numbers HA36 and BE36 in base 36, expressing your answer in the same form, i.e., in base 36 ...
A: In decimal In base 36 0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 A 11 B ...
Q: nctions that implement each of the following sorting algorithms. Please use the function prototypes ...
A: As per rule, allowed to answer first question and post the remaining in the next submission. The u...
Q: Q3 In the IPv4 Header format following information is given in decimal number system , with respect ...
A: Lets see the solution in the next steps
Q: Describe the various hardware security and tracking devices on the market, as well as how they are u...
A: Introduction: Many devices are now available for securing and tracking hardware. The primary goal of...
Q: Example-3: Write a program to calculate the Area and volume for a sphere. Sol. -The area of sphere 4...
A: The following step calculates the area and volume of a sphere with a given radius r. To find area of...
Q: Python Program: Create a program that designs and uses: Code Organization (Things liked identifier...
A: if choice == 'a': print("You chose 'a'.") elif choice == 'b': print("You chose 'b'.") elif choice ==...
Q: The sequential and binary search algorithms each have their own set of benefits, but what are the gu...
A: Let's see the solution in the next steps
Q: Two players take turns alternatively in placing signs (+ or -) before them, and then they all are ad...
A: Explanation: If the total of the array's items is even, player 1 wins; otherwise, player 2 wins. To ...
Q: Mention the primary language or platform utilised for web design.
A: Introduction: I must indicate the primary language or platform utilised for web creation here.
Q: define the term property
A: Hi there, Please find your solution below, I hope you would find my solution useful and helpful. Tha...
Q: What is data abstraction in DBMS?
A: I'm providing the answer of Data abstraction in DBMS. I hope this will be helpful for you...
Q: r) Input a string s that contains lowercase alphabets. Then write a function that takes the string s...
A: The solution to the given problem is below.
Q: What are the respective positions of the previously discussed protocols (DNS, ARP, HTTP, ICMP and TC...
A: answer is
Q: What are some of the main reasons he gives for having a robust cyber defence?
A: Introduction: Defending your device, software, and network from cyberattacks or threats is what cybe...
Q: Example-3: Write a program to calculate the Area and volume for a sphere. Sol. -The area of sphere =...
A: C++ Program for above : #include <iostream> using namespace std; int main() { //get ...
Q: a. List two problems and two applications each for the following software process models. i. Evoluti...
A: Below is the answer to above questions. I hope this will be helpful for you....
Q: Define the characteristics that are required for test-driven development. In the event that you wish...
A: With respect to your question answer is given below:- According to the question, essential principle...
Q: Describe how a programming language evolved.
A: Intro Programming language: - A device must be supplied with instructions in the programming languag...
Q: When a router receives an ARP request that is meant for a distant host, it can respond with which of...
A: Introduction: An ARP request is necessary when a device wants to determine the MAC address of anothe...
Q: What are the benefits of eliminating data redundancy?
A: The question is about the data redundancy in the database and why we try to eliminate it.
Q: Why have some of these packets been sent to a MAC address that is not the Access Switch/Router? Expl...
A: There are a couple of justifications for why packets may be shipped off a MAC address that isn't the...
Q: What is string in multiple line
A: What is string in multiple line and how do you execute strings in multiple lime in C programming? An...
Q: A list of the six components of an information system should be created, followed by definitions of ...
A: Introduction:Information System (IS): An information system is a system for orga...
Q: Execute the following commands in the order listed below and obtain a (single) screenshot showing th...
A: Display the current date using the ‘date’ command (press Enter at the prompt to keep the same date) ...
Q: What are the memory addressing capabilities of the 20-bit address bus?
A: Introduction: the question is about the memory addressing capabilities of the 20-bit address bus
Q: Explain physical data independence and its significance in database systems.
A: Introduction Physical information Independence : Physical information Independence is outlined becau...
Q: keys 53, 27, 75, 25, 70, 41, 38, 16, 59, 36, 73, 65, 60, 46, 55, 33, 68, 79, and 48 build a balance...
A: Each node stores at most 3 valuesEach internal node is a 2-node, 3-node, or 4-nodeAll the leaves are...
Q: Networks that are interconnected require the use of communication processor devices like as switches...
A: Given: Networks that are interconnected require the use of communication processor devices like as s...
Q: Suppose that a byte contains 20 (in hex). (a) Given that this byte is the ASCII code for a character...
A: I'm providing the all subparts of above query. I hope this will helpful for you...
Q: 1. Numbers, Codes, Logic, Circuits a) Convert 101001012 to decimal. b) Convert -6310 to binary using...
A: Convert 57 decimal to binary Convery 66 decimal to hexadecimal Convert AC9 hexadecimal to decimal A...
Q: There are two computers, each one has CPU A and CPU B respectively, which are running the same Progr...
A: Answer: Given computer1 number of CPU clock cycle is 500 for computer 2 instruction count 300 and ...
Q: Describe how organizational culture is related to project management. What type of culture do you th...
A: Organisational culture is related to project management in many ways.
Q: A local pizza shop is selling a large pizza for $9.99. Given the number of pizzas to order as input,...
A: import java.util.Scanner; public class LabProgram{ public static void main(String[] args) { Sc...
Q: Explain procedure return code briefly.
A: When a procedure is invoked, the computer's CPU executes the code. The code will eventually return t...
Q: Describe two applications that might be better suited to assembly language than than a high-level la...
A: Applications that suited to assembly language:
Q: Which INT 10h function is responsible for the current visual mode?
A: Intro the above question is about Which INT 10h function is responsible for the current visual mode?...
Q: What is the return value of the following call: bin_search([3, 6, 8, 9, 10, 15, 17], 17)? O True Fal...
A: A binary tree consists of several nodes in which each node must have two child nodes. one is left ch...
Q: :the output of (Print "a", "b", "c") is abc O ab c abc
A: With respect to your question answer is given below:- According to the question, this double quote...
Q: Consider that there is a new student information system (SIS) for our university. Before launching S...
A: Verification: It is nothing but a technique which is static analysis and hence testing happens witho...
Q: Consider the WAN, or wide-area network, as your preferred means of wireless connectivity. What disti...
A: Intro It can be tough to defend your home wireless network from infiltration if your wifi connection...
Q: sin'a 1) Let A = 1-cos and B = B for x = 0.1,0.01, 0.001, 0.0001,0.00001, and calculate the error fo...
A: 1) clc;clear all;close all;x=[0.1,0.01,0.001,0.0001,0.00001];A=(1-cos(x))./(x.*x);B=(sin(x).*sin(x))...
Q: What are the reasons Pine Valley Furniture Company could require a data warehouse?
A: Data warehouse for Pine Valley Furniture Company (PVFC) Combining the data from one or more sources ...
Q: Consider a Computer which has a memory which is capable of storing 4096 K words and each word in me...
A: Given: The memory size, number of registers, and number of addressing modes are all supplied to us. ...
Q: We discussed that in the requirements phase we define "What" versus "How". What does that mean? Why ...
A: Requirements is one of the most important phase of the development model. It is the stage where the ...
Q: Make 5 questions about this diagram
A: the five question on the diagram is an given below :
Q: Queue operates in FIFO and Stack operates in LIFO’ - explain their operations according to this phen...
A: Stack (LIFO): It is a linear data structure in which the elements can be inserted and deleted only f...
Q: Computer sciences 5. What does Elasticache imply?
A: Introduction: Elasticache is a web service that makes it simple to install and store data in the clo...
Q: Given a transmission rate of 1 Gbps and a propagation speed of 200m / μ sec , how many meters of ca...
A: Transmission Rate = 1 Gbps = 109 bits per second Propagation Speed = 200 metre / micro second = 200 ...
Q: 2.In the 'Table Area' below, create a table with three headings with the following order: Year, Tota...
A: MS excel is a worksheet that is used to store and analyze numerical data. It has functions that make...
Q: The Department of Defense model (also known as the TCP/IP stack) is composed of four layers. Which l...
A: Introduction: The Department of Defense model (also known as the TCP/IP stack) is composed of four l...
i am having this error with my code . please help me figure it out
Step by step
Solved in 2 steps
- in java Integer numVals is read from input and integer array userCounts is declared with size numVals. Then, numVals integers are read from input and stored into userCounts. If the first element is less than the last element, then assign Boolean firstSmaller with true. Otherwise, assign firstSmaller with false. Ex: If the input is: 5 40 22 41 84 77 then the output is: First element is less than last element 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 import java.util.Scanner; public class UserTracker { publicstaticvoidmain(String[] args) { Scannerscnr=newScanner(System.in); intnumVals; int[] userCounts; inti; booleanfirstSmaller; numVals=scnr.nextInt(); userCounts=newint[numVals]; for (i=0; i<userCounts.length; ++i) { userCounts[i] =scnr.nextInt(); } /* Your code goes here */ if (firstSmaller) { System.out.println("First element is less than last element"); } else { System.out.println("First element is not less…class BinaryImage: def __init__(self): pass def compute_histogram(self, image): """Computes the histogram of the input image takes as input: image: a grey scale image returns a histogram as a list""" hist = [0]*256 return hist def find_otsu_threshold(self, hist): """analyses a histogram it to find the otsu's threshold assuming that the input hstogram is bimodal histogram takes as input hist: a bimodal histogram returns: an optimal threshold value (otsu's threshold)""" threshold = 0 return threshold def binarize(self, image): """Comptues the binary image of the the input image based on histogram analysis and thresholding take as input image: an grey scale image returns: a binary image""" bin_img = image.copy() return…java getDup accepts an array and returns an int. If there is any element is duplicated, the method counts how many of those present in the array. Example : getDup(["1","2","aa"',"1"]) returns:2 ("1" is duplicated and there are two "1"s so return is 2) class Main { public static int getDup(String[] r) { } public static void main(String[] args) { Scanner in = new Scanner(System.in); String [] strs = new String[in.nextInt()]; for(int i=0; i < strs.length; i++) { strs[i] = in.next(); } System.out.println(getDup(strs)); } } hint: you will need a nested array the will run on the array we get from the method argument. inside the nested loop you will need to check if the main array element is equal to the current
- in java Integer numVals is read from input and integer array userScore is declared with size numVals. Then, numVals integers are read from input and stored into userScore. Replace the last element in userScore with -1. Ex: If the input is: 4 93 94 9 42 then the output is: Updated scores: 93 94 9 -1Please help me fix this code Make it run out like the picture import java.util.ArrayList; import java.util.Random; import java.util.Scanner; public class FrogListApp { public static void main(String[] args) { final int MIN_WEIGHT = 1; final int MAX_WEIGHT = 25; // Step 3: Create an array list to store Frog objects ArrayList frogsList = new ArrayList<>(); // Step 4: Create a Scanner object Scanner scanner = new Scanner(System.in); // Step 5: Read an integer as the number of frogs // using prompt "Enter the number of frogs: " System.out.print("Enter the number of frogs: "); int numberOfFrogs = scanner.nextInt(); // Step 6: Read an integer as the random generator seed // using prompt…Implement in C Program 5.20 LAB: Word frequencies Write a program that reads a list of words. Then, the program outputs those words and their frequencies. The input begins with an integer indicating the number of words that follow. Assume that the list will always contain fewer than 20 words, and each word contains fewer than 10 characters. Ex: If the input is: 5 hey hi Mark hi mark the output is: hey - 1 hi - 2 Mark - 1 hi - 2 mark - 1 Hint: Use two arrays, one array for the strings and one array for the frequencies. #include <stdio.h>#include <string.h> int main(void) { /* Type your code here. */ return 0;}
- java: Run length coding is a method to represent a string in a more compact manner. Each character that occurs more than 2 times in a row is represented by the character and a number following it. Two examples are: "abba" → "abba""abcccbbbba" → "abc3b4a"Write a function that calculates how many characters the encoded string is shorter than the original.For any element in keysList with a value greater than 40, print the corresponding value in itemsList, followed by a semicolon (no spaces). Ex: If the input is: 32 105 101 35 10 20 30 40 the output is: 20;30; import java.util.Scanner; public class Compare { public static void main(String args[]) {final int SIZE_LIST = 4;int[] keysList = new int[SIZE_LIST];int[] itemsList = new int[SIZE_LIST];int i;Scanner input = new Scanner(System.in); keysList[0] = input.nextInt();keysList[1] = input.nextInt();keysList[2] = input.nextInt();keysList[3] = input.nextInt(); itemsList[0] = input.nextInt();itemsList[1] = input.nextInt();itemsList[2] = input.nextInt();itemsList[3] = input.nextInt(); /* Your code goes here */ System.out.println();} }JAVA - Multi Dimensional Arrays Ask the user for the number of rows and columns of a two-dimensional array and then its integer elements. Print the row number of the row where the sum of all of its elements is even. For this problem, it is guaranteed that there is one and only one row of such case. Row count starts at 0. Input 1. One line containing an integer for the number of rows 2. One line containing an integer for the number of columns 3. Multiple lines containing at least one integer each line for the elements of the array Sample 2 7 4 1 1 2 0 5 0 Output Note that the row number starts at 0, not 1. Enter # of rows: 3 Enter # of columns: 3 Enter elements: 2 7 4 1 1 2 0 5 0 Even row: 1
- For any element in keysList with a value smaller than 50, print the corresponding value in itemsList, followed by a space. Ex: If the input is: 32 105 101 35 10 20 30 40 the output is: 10 40 import java.util.Scanner; public class Compare { public static void main(String args[]) { final int SIZE_LIST = 4; int[] keysList = new int[SIZE_LIST]; int[] itemsList = new int[SIZE_LIST]; int i; Scanner input = new Scanner(System.in); keysList[0] = input.nextInt(); keysList[1] = input.nextInt(); keysList[2] = input.nextInt(); keysList[3] = input.nextInt(); itemsList[0] = input.nextInt(); itemsList[1] = input.nextInt(); itemsList[2] = input.nextInt(); itemsList[3] = input.nextInt(); //answer// System.out.println(); } }in java ecplise . Implement a program that randomly generates 10 integers from -100 to 100,stores them in a 1D array, and finds their maximum value. Calculate theexecution time of finding a maximum. Repeat the test for 10,000 and10,000,000 numbers. Provide your results in the form of a table below andprovide a small summary.please help me with the following 1) make a sierpenski triangle using java and recursion. Make it similar to the code below. And please comment the code 2) Please make the follow code out put on the console. It a t square fractal import java.awt.image.*;import java.awt.Color;import java.io.*;import javax.imageio.*; public class Main{ static final int DIMENSION = 1000; static BufferedImage image = new BufferedImage(DIMENSION, DIMENSION, BufferedImage.TYPE_INT_RGB); static final int WHITE = Color.WHITE.getRGB(); static final int BLACK = Color.BLACK.getRGB(); private static void drawSquare(int x, int y, int side) { if (side <= 0) return; else { int left = x - side/2; int top = y - side/2; int right = x + side/2; int bottom = y + side/2; for (int i = left; i < right; i++) for (int j = top; j < bottom; j++) { image.setRGB(i, j, BLACK); }…